- SEE ALSO
- COPYRIGHT AND LICENSE
Date::TimeOfDay - Represent time of day (hh:mm:ss)
use Date::TimeOfDay; my $tod = Date::TimeOfDay->new( hour=>23, minute=>59, second=>59, # nanosecond => 999_999_999, # optional );
EARLY RELEASE, API MIGHT CHANGE WITHOUT NOTICE.
This is a simple module to represent time of day. Interface is modelled after DateTime. Internal representation is currently float (number of seconds from midnight 00:00:00). Currently does not handle leap second nor time zone.
* set * strftime * add DateTime + TimeOfDay * add TimeOfDay + TimeOfDay * convert to duration * convert to another time zone
my $tod = Date::TimeOfDay->from_hms(hms => "23:59:59"); say $tod; # => "23:59:59"
my $tod = Date::TimeOfDay->from_float(float => 86399); say $tod; # => "23:59:59"
$tod->hms([ $sep ])
Default separator is ":".
Is also invoked via overload of q("").
$tod->compare($tod2); # -1 if $tod is less than $tod2, 0 if equal, 1 if greater than
This software is copyright (c) 2018 by email@example.com.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.