summaryrefslogtreecommitdiff
path: root/systems/texlive/tlnet/tlpkg/tlperl/lib/Time/Piece.pm
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2021-04-02 03:20:54 +0000
committerNorbert Preining <norbert@preining.info>2021-04-02 03:20:54 +0000
commit3f173002d4a4a84e7d1fa5a74755fdd00d08a9c2 (patch)
tree5ed380344702de1f9ab53b68b6c3bcd6b8458087 /systems/texlive/tlnet/tlpkg/tlperl/lib/Time/Piece.pm
parentf78ba658b3ecd56053fe0837a4404d0c6c16a707 (diff)
CTAN sync 202104020320
Diffstat (limited to 'systems/texlive/tlnet/tlpkg/tlperl/lib/Time/Piece.pm')
-rw-r--r--systems/texlive/tlnet/tlpkg/tlperl/lib/Time/Piece.pm23
1 files changed, 19 insertions, 4 deletions
diff --git a/systems/texlive/tlnet/tlpkg/tlperl/lib/Time/Piece.pm b/systems/texlive/tlnet/tlpkg/tlperl/lib/Time/Piece.pm
index d5624636c6..f5d87cd031 100644
--- a/systems/texlive/tlnet/tlpkg/tlperl/lib/Time/Piece.pm
+++ b/systems/texlive/tlnet/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