Manual Reference Pages - TIME::SECONDS (3)
Time::Seconds - a simple API to convert seconds to other date values
my $t = localtime;
$t += ONE_DAY;
my $t2 = localtime;
my $s = $t - $t2;
print "Difference is: ", $s->days, "\n";
This module is part of the Time::Piece distribution. It allows the user
to find out the number of minutes, hours, days, weeks or years in a given
number of seconds. It is returned by Time::Piece when you delta two
Time::Seconds also exports the following constants:
Since perl does not (yet?) support constant objects, these constants are in
seconds only, so you cannot, for example, do this: print ONE_WEEK->minutes;
The following methods are available:
my $val = Time::Seconds->new(SECONDS)
$val->financial_months; # 30 days
$val->pretty; # gives English representation of the delta
The usual arithmetic (+,-,+=,-=) is also available on the objects.
The methods make the assumption that there are 24 hours in a day, 7 days in
a week, 365.24225 days in a year and 12 months in a year.
(from The Calendar FAQ at http://www.tondering.dk/claus/calendar.html)
Matt Sergeant, firstname.lastname@example.org
Tobias Brox, email@example.com
COPYRIGHT AND LICENSE
Copyright 2001, Larry Wall.
This module is free software, you may distribute it under the same terms
Currently the methods arent as efficient as they could be, for reasons of
clarity. This is probably a bad idea.
|perl v5.20.3 ||SECONDS (3) ||2013-09-06 |
Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.