gettime
Summary
Converts a UNIX timestamp to a human friendly structure.Usage
gettime( timestamp )
Parameters
| Name | Type | Description | Required |
|---|---|---|---|
| timestamp | integer | A UNIX timestamp. | Yes. |
Returns
An associative array (see below).Description
This operator takes a UNIX timestamp as a parameter and returns an associative array that contains a human friendly representation of the provided timestamp. The following table shows the keys of the returned hash.
| Key | Type | Description |
|---|---|---|
| seconds |
integer |
Number of seconds. |
| minutes |
integer |
Number of minutes. |
| hours |
integer |
Number of hours. |
| day |
integer |
The day of the month (1-31). |
| month |
integer |
The month number (1 is January). |
| year |
integer |
A four digit representation of the year (for example "1978"). |
| weekday |
integer |
The day of the week (1-7). |
| weeknumber |
string |
The week of the year (1-52). |
| yearday |
integer |
The day of the year (1-365). |
| epoch |
integer |
The UNIX timestamp that was provided. |
Examples
Example 1
{gettime( currentdate() )|attribute(show)}
The "currentdate" operator is used to generate the UNIX timestamp for the current date/time. This value is then fed to the "gettime" operator, which converts it to a human friendly structure. The array is viewed using the "attribute" operator. The following output will be produced:
| Attribute | Type | Value |
|---|---|---|
| seconds |
integer |
11 |
| minutes |
integer |
5 |
| hours |
integer |
15 |
| day |
integer |
13 |
| month |
integer |
4 |
| year |
integer |
2005 |
| weekday |
integer |
4 |
| weeknumber |
string |
15 |
| yearday |
integer |
102 |
| epoch |
integer |
1113397511 |
Balazs Halasy (21/03/2005 9:40 am)
Svitlana Shatokhina (23/01/2006 3:23 pm)
Comments
Alternative ways to format time and date
Thursday 08 March 2007 9:07:03 am
Torgeir Fritsvold
http://ez.no/doc/ez_publish/techn...ng_and_internationalization/datetime
http://ez.no/doc/ez_publish/techn...atting_and_internationalization/l10n