Time::Consts - Define time constants with specified base


Time-Consts documentation  | view source Contained in the Time-Consts distribution.

Index


NAME

Top

Time::Consts - Define time constants with specified base

SYNOPSIS

Top

    # 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

Top

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

Top

Bad argument(s): %s

(F) Self-explanatory.

Too many units: %s

(F) Self-explanatory.

AUTHOR

Top

Johan Lodin <lodin@cpan.org>

COPYRIGHT

Top

SEE ALSO

Top

Time::Seconds


Time-Consts documentation  | view source Contained in the Time-Consts distribution.