Class::Usul::Time - Functions for date and time manipulation
use Class::Usul::Time qw( time2str );
This module implements a few simple time related functions
nap( $period );
Sleep for a given number of seconds. The sleep time can be a fraction of a second
$date_time = str2date_time( $dstr, [$zone] );
Parse a date time string and return a DateTime object. The time zone is optional
$time = str2time( $dstr, [$zone] );
Parse a date time string and return the number of seconds elapsed since the epoch. This subroutine is copyright (c) 1995 Graham Barr. All rights reserved. It has been modified to treat 9/11 as the ninth day in November. The time zone is optional
$time_piece = str2time_piece( $dstr, [$zone] );
Parse a date time string and return a Time::Piece object. The time zone is optional
$time_string = time2str( [$format], [$time], [$zone] );
Returns a formatted string representation of the given time (supplied in seconds elapsed since the epoch). Defaults to ISO format (%Y-%m-%d %H:%M:%S) and current time if non supplied. The timezone defaults to local time
None
There are no known incompatibilities in this module.
There are no known bugs in this module. Please report problems to the address below. Patches are welcome
Peter Flanigan, <pjfl@cpan.org>
<pjfl@cpan.org>
Copyright (c) 2018 Peter Flanigan. All rights reserved
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic
This program is distributed in the hope that it will be useful, but WITHOUT WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE
To install Class::Usul, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Class::Usul
CPAN shell
perl -MCPAN -e shell install Class::Usul
For more information on module installation, please visit the detailed CPAN module installation guide.