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

NAME

Time::Consts - Define time constants with specified base

SYNOPSIS

    # Define all constants.
    use Time::Consts qw/ :ALL /;

    # Define just MIN and HOUR.
    use Time::Consts qw/ MIN HOUR /;

    # Set MIN to base, i.e. SEC = 1/60, MIN = 1, etc.
    use Time::Consts qw/ min SEC MIN /;

DESCRIPTION

Time::Consts can define time constants for you. Those available are

    MSEC
    SEC
    MIN
    HOUR
    DAY
    WEEK

and are provided as arguments to the use() statements. An ':ALL' tag is provided to export all of the above. Default base is seconds, but that can be changed by supplying a lowercase version of any of the constants to the use statement. Note that giving a lowercase base doesn't mean that the corresponding constant automatically will be defined.

If you at any time would want to have any of the constants in another base than the one given to the use() statement just divide with that constant. E.g. WEEK / HOUR will always return 168, i.e. the number of hours per week.

If you do calendar math consider using a module designed for that.

DIAGNOSTICS

Bad argument(s): %s

(F) Self-explanatory.

Too many units: %s

(F) Self-explanatory.

AUTHOR

Johan Lodin <lodin@cpan.org>

COPYRIGHT

Copyright 2004-2005 Johan Lodin. All rights reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO

Time::Seconds