diff options
author | Siep Kroonenberg <siepo@cybercomm.nl> | 2021-03-03 11:04:20 +0000 |
---|---|---|
committer | Siep Kroonenberg <siepo@cybercomm.nl> | 2021-03-03 11:04:20 +0000 |
commit | 13c3572d26e0868b9665513e4646ade860ae7810 (patch) | |
tree | 72f68d7c1270cc0a1d504f8eeb45d4de6b36f2d1 /Master/tlpkg/tlperl/lib/Time/Piece.pm | |
parent | 87d16a01498a53c4bb455d78ae7131370e47591e (diff) |
Updated tlperl
git-svn-id: svn://tug.org/texlive/trunk@58075 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/tlperl/lib/Time/Piece.pm')
-rw-r--r-- | Master/tlpkg/tlperl/lib/Time/Piece.pm | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/Master/tlpkg/tlperl/lib/Time/Piece.pm b/Master/tlpkg/tlperl/lib/Time/Piece.pm index d5624636c6f..f5d87cd0316 100644 --- a/Master/tlpkg/tlperl/lib/Time/Piece.pm +++ b/Master/tlpkg/tlperl/lib/Time/Piece.pm @@ -19,7 +19,7 @@ our %EXPORT_TAGS = ( ':override' => 'internal', ); -our $VERSION = '1.33'; +our $VERSION = '1.3401'; XSLoader::load( 'Time::Piece', $VERSION ); @@ -126,6 +126,7 @@ sub _mktime { if ($class->_is_time_struct($time)) { my @new_time = @$time; my @tm_parts = (@new_time[c_sec .. c_mon], $new_time[c_year]+1900); + $new_time[c_epoch] = $islocal ? timelocal(@tm_parts) : timegm(@tm_parts); return wantarray ? @new_time : bless [@new_time[0..9], $islocal], $class; @@ -805,8 +806,14 @@ sub use_locale { #get locale month/day names from posix strftime (from Piece.xs) my $locales = _get_localization(); - $locales->{PM} ||= ''; - $locales->{AM} ||= ''; + #If AM and PM are the same, set both to '' + if ( !$locales->{PM} + || !$locales->{AM} + || ( $locales->{PM} eq $locales->{AM} ) ) + { + $locales->{PM} = ''; + $locales->{AM} = ''; + } $locales->{pm} = lc $locales->{PM}; $locales->{am} = lc $locales->{AM}; @@ -896,7 +903,7 @@ in perlfunc will still return what you expect. The module actually implements most of an interface described by Larry Wall on the perl5-porters mailing list here: -L<http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2000-01/msg00241.html> +L<https://www.nntp.perl.org/group/perl.perl5.porters/2000/01/msg5283.html> =head1 USAGE @@ -1152,6 +1159,14 @@ moves afoot to fix that in perl. Alternatively use 64 bit perl. Or if none of those are options, use the L<DateTime> module which has support for years well into the future and past. +Also, the internal representation of Time::Piece->strftime deviates from the +standard POSIX implementation in that is uses the epoch (instead of separate +year, month, day parts). This change was added in version 1.30. If you must +have a more traditional strftime (which will normally never calculate day +light saving times correctly), you can pass the date parts from Time::Piece +into the strftime function provided by the POSIX module +(see strftime in L<POSIX> ). + =head1 AUTHOR Matt Sergeant, matt@sergeant.org |