API:EPrints/Time
Latest Source Code (3.4, 3.3) | Revision Log | Before editing this page please read Pod2Wiki
Contents
NAME
EPrints::Time - Time and Date-related functions
DESCRIPTION
This package contains functions related to time/date functionality.
render_date
$xhtml = EPrints::Time::render_date( $session, $datevalue )
Render the given date or date and time as a chunk of XHTML.
The date given is in UTC but it will be rendered in the local offset.
gmt_off
$xhtml = EPrints::Time::gmt_off()
Render the current time offset in seconds. This just diffs gmtime and localtime.
get_month_label
$label = EPrints::Time::get_month_label( $session, $monthid )
Return a UTF-8 string describing the month, in the current lanugage.
$monthid is an integer from 1 to 12.
get_date_array
($year,$month,$day) = EPrints::Time::get_date_array( [$time] )
Static method that returns the given time (in UNIX time, seconds since 1.1.79) in an array.
This is the local date not the UTC date.
get_iso_date
$datestamp = EPrints::Time::get_iso_date( [$time] )
Method that returns the given time (in UNIX time, seconds since 1.1.79) in the format used by EPrints and MySQL (YYYY-MM-DD).
This is the localtime date, not UTC.
human_time
$timestamp = EPrints::Time::human_time( [$time] )
Return a string describing the current local date and time in the current locale's format (see Perl's 'localtime).
get_iso_timestamp
$timestamp = EPrints::Time::get_iso_timestamp( [$time] );
Return a UTC timestamp of the form YYYY-MM-DDTHH:MM:SSZ
e.g. 2005-02-12T09:23:33Z
$time in seconds from 1970. If not defined then assume current time.