API:EPrints/Time

From EPrints Documentation
Revision as of 18:29, 11 August 2009 by Tdb01r (talk | contribs) (New page: <!-- Pod2Wiki=_preamble_ This page has been automatically generated from the EPrints source. Any wiki changes made between the 'Pod2Wiki=*' and 'End of Pod2Wiki' comments will be lost. -...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Latest Source Code (3.4, 3.3) | Revision Log | Before editing this page please read Pod2Wiki

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.

UNDOCUMENTED METHODS

Warning These methods were found in the source code but didn't have any POD associated with them. This may be because we haven't got around to documenting them yet or it could be because they are internal to the API and not intended for use by other parts of EPrints.

datestring_to_timet

get_date

get_month_label_short

human_delay

render_short_date