summaryrefslogtreecommitdiff
path: root/Master/tlpkg/tlperl/lib/Time/Seconds.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Master/tlpkg/tlperl/lib/Time/Seconds.pm')
-rw-r--r--Master/tlpkg/tlperl/lib/Time/Seconds.pm76
1 files changed, 36 insertions, 40 deletions
diff --git a/Master/tlpkg/tlperl/lib/Time/Seconds.pm b/Master/tlpkg/tlperl/lib/Time/Seconds.pm
index 8e5b52b269f..965e3a6e502 100644
--- a/Master/tlpkg/tlperl/lib/Time/Seconds.pm
+++ b/Master/tlpkg/tlperl/lib/Time/Seconds.pm
@@ -1,53 +1,49 @@
package Time::Seconds;
use strict;
-use vars qw/@EXPORT @EXPORT_OK/;
-our $VERSION = '1.29';
+our $VERSION = '1.31';
use Exporter 5.57 'import';
-@EXPORT = qw(
- ONE_MINUTE
- ONE_HOUR
- ONE_DAY
- ONE_WEEK
+our @EXPORT = qw(
+ ONE_MINUTE
+ ONE_HOUR
+ ONE_DAY
+ ONE_WEEK
ONE_MONTH
- ONE_REAL_MONTH
ONE_YEAR
- ONE_REAL_YEAR
ONE_FINANCIAL_MONTH
- LEAP_YEAR
+ LEAP_YEAR
NON_LEAP_YEAR
);
-@EXPORT_OK = qw(cs_sec cs_mon);
-
-use constant ONE_MINUTE => 60;
-use constant ONE_HOUR => 3_600;
-use constant ONE_DAY => 86_400;
-use constant ONE_WEEK => 604_800;
-use constant ONE_MONTH => 2_629_744; # ONE_YEAR / 12
-use constant ONE_REAL_MONTH => '1M';
-use constant ONE_YEAR => 31_556_930; # 365.24225 days
-use constant ONE_REAL_YEAR => '1Y';
-use constant ONE_FINANCIAL_MONTH => 2_592_000; # 30 days
-use constant LEAP_YEAR => 31_622_400; # 366 * ONE_DAY
-use constant NON_LEAP_YEAR => 31_536_000; # 365 * ONE_DAY
-
-# hacks to make Time::Piece compile once again
-use constant cs_sec => 0;
-use constant cs_mon => 1;
-
-use overload
- 'fallback' => 'undef',
- '0+' => \&seconds,
- '""' => \&seconds,
- '<=>' => \&compare,
- '+' => \&add,
- '-' => \&subtract,
- '-=' => \&subtract_from,
- '+=' => \&add_to,
- '=' => \&copy;
+our @EXPORT_OK = qw(cs_sec cs_mon);
+
+use constant {
+ ONE_MINUTE => 60,
+ ONE_HOUR => 3_600,
+ ONE_DAY => 86_400,
+ ONE_WEEK => 604_800,
+ ONE_MONTH => 2_629_744, # ONE_YEAR / 12
+ ONE_YEAR => 31_556_930, # 365.24225 days
+ ONE_FINANCIAL_MONTH => 2_592_000, # 30 days
+ LEAP_YEAR => 31_622_400, # 366 * ONE_DAY
+ NON_LEAP_YEAR => 31_536_000, # 365 * ONE_DAY
+ # hacks to make Time::Piece compile once again
+ cs_sec => 0,
+ cs_mon => 1,
+};
+
+use overload
+ 'fallback' => 'undef',
+ '0+' => \&seconds,
+ '""' => \&seconds,
+ '<=>' => \&compare,
+ '+' => \&add,
+ '-' => \&subtract,
+ '-=' => \&subtract_from,
+ '+=' => \&add_to,
+ '=' => \&copy;
sub new {
my $class = shift;
@@ -229,8 +225,8 @@ The following methods are available:
$val->hours;
$val->days;
$val->weeks;
- $val->months;
- $val->financial_months; # 30 days
+ $val->months;
+ $val->financial_months; # 30 days
$val->years;
$val->pretty; # gives English representation of the delta