1 | <?php |
||
5 | class Date |
||
6 | { |
||
7 | /** |
||
8 | * Given a timestamp, return the corresponding ISO8601 encoded string. |
||
9 | * |
||
10 | * Really, timezones ought to be supported |
||
11 | * but the XML-RPC spec says: |
||
12 | * |
||
13 | * "Don't assume a timezone. It should be specified by the server in its |
||
14 | * documentation what assumptions it makes about timezones." |
||
15 | * |
||
16 | * These routines always assume localtime unless |
||
17 | * $utc is set to 1, in which case UTC is assumed |
||
18 | * and an adjustment for locale is made when encoding |
||
19 | * |
||
20 | * @param int $timet (timestamp) |
||
21 | * @param int $utc (0 or 1) |
||
22 | * |
||
23 | * @return string |
||
24 | */ |
||
25 | 19 | public static function iso8601Encode($timet, $utc = 0) |
|
41 | |||
42 | /** |
||
43 | * Given an ISO8601 date string, return a timet in the localtime, or UTC. |
||
44 | * |
||
45 | * @param string $idate |
||
46 | * @param int $utc either 0 or 1 |
||
47 | * |
||
48 | * @return int (datetime) |
||
49 | */ |
||
50 | public static function iso8601Decode($idate, $utc = 0) |
||
63 | } |
||
64 |