LibWeb::Time - Various time formats for libweb applications
- BSD, Linux, Solaris and Windows.
-
use LibWeb::Time();
my $time = new LibWeb::Time();
my $wday_mon_mday = $time->get_date();
my $hh_mm_ss = $time->get_time();
my $wday_mon_dd_hh_mm_ss_yyyy = $time->get_datetime();
my $yyyymmddhhmmss = $time->get_timestamp();
my $yyyy = $time->get_year();
This class uses the perl's localtime() routine to provide
several methods which return time in several formats.
The current version of LibWeb::Time is available at
http://libweb.sourceforge.net
Several LibWeb applications (LEAPs) have be written, released and are
available at
http://leaps.sourceforge.net
get_date()
Return 'wday mon mday' as a string, e.g. 'Sun May 28'.
get_time()
Return 'hh:mm:ss' as a string, e.g. '14:35:47'.
get_datetime()
Return 'wday mon dd hh:mm:ss yyyy' as a string, e.g. 'Sun May 28 14:35:47
2000'. This is the same as using the perl's localtime()
directly in scalar context.
get_timestamp()
Return 'yyyymmddhhmmss' as a string, e.g. '20000528133547'.
get_year()
Return 'yyyy' as a string, e.g. '2000'.
- Colin Kong (colin.kong(at)utoronto.ca)
-
|