Hub::Misc::Time - Hub::Misc::Time documentation


hub-standard documentation  | view source Contained in the hub-standard distribution.

Index


NAME

Top

Hub::Misc::Time -

SYNOPSIS

Top

DESCRIPTION

Top

PUBLIC METHODS

Top

datetime

Friendly date-time formats of seconds-since-the-epoch timestamps.





 Usage: datetime [$timestamp], [options]




Default is the current time formatted as: MM/DD/YYYY hh:mm:ss.

The decimal portion of HiRest time is truncated.

Uses `localtime` to localize.

Example returns: true:

    datetime( );




Example returns: regex:

    datetime( 1045837284 );




Example returns: regex:

    datetime( 1045837284, -nosec );




Example returns: regex:

    datetime( 1045837284, -noyear );




Example returns: regex:

    datetime( 1045837284, -ampm );




Example returns: regex:

    datetime( 1045837284, -nozeros );




Example returns: regex:

    datetime( 1045837284, -notime );




Example returns: regex:

    datetime( 1045837284, -nodate );




Example returns: regex:

    datetime( 1045837284, -letter );







Combining options

Example returns: regex:

    datetime( 1045837284, -ampm, -nosec );              










Example returns: regex:

    datetime( 1045837284, -nosec, -nozeros, -noyear );







dhms

Hub::dhms( $seconds, $options, $format )

Format the provided number of seconds in days, hours, minutes, and seconds.






  Examples:                                               Returns:
  ------------------------------------------------------- --------------------
  Hub::dhms( 10 )                                              00d:00h:00m:10s
  Hub::dhms( 60 )                                              00d:00h:01m:00s
  Hub::dhms( 3600 )                                            00d:01h:00m:00s
  Hub::dhms( 86400 )                                           01d:00h:00m:00s
  Hub::dhms( 11 )                                              00d:00h:00m:11s
  Hub::dhms( 71 )                                              00d:00h:01m:11s
  Hub::dhms( 3671 )                                            00d:01h:01m:11s
  Hub::dhms( 90071 )                                           01d:01h:01m:11s
  Hub::dhms( 90071, "--nozeros" )                              1d:1h:1m:11s
  Hub::dhms( 90071, "--nozeros" )                              1d:1h:1m:11s
  Hub::dhms( 90071, "--nozeros", "[#d]days [#h]:[#m]:[#s]" )   1days 1:1:11
  Hub::dhms( 90071, "[#d]days [#h]:[#m]:[#s]" )                01days 01:01:11







AUTHOR

Top

Ryan Gies (ryangies@livesite.net)

COPYRIGHT

Top

UPDATED

Top

08/02/2007


hub-standard documentation  | view source Contained in the hub-standard distribution.