The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

Name

Class::Usul::Time - Class methods for date and time manipulation

Synopsis

   use Class::Usul::Time qw(time2str);

Description

This module implements a few simple time related subroutines

Subroutines/Methods

nap

   nap( $period );

Sleep for a given number of seconds. The sleep time can be a fraction of a second

str2date_time

   $date_time = str2date_time( $dstr, [$zone] );

Parse a date time string and return a DateTime object. Timezone optional

str2time

   $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. Timezone optional

time2str

   $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

Diagnostics

None

Configuration and Environment

None

Dependencies

DateTime::Format::Epoch
Time::HiRes
Time::Local
Time::Zone

Incompatibilities

There are no known incompatibilities in this module.

Bugs and Limitations

There are no known bugs in this module. Please report problems to the address below. Patches are welcome

Author

Peter Flanigan, <pjfl@cpan.org>

License and Copyright

Copyright (c) 2015 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