1 | <?php |
||
10 | trait Time |
||
11 | { |
||
12 | /** |
||
13 | * Convert timestamp to HTTP-date (RFC2616) |
||
14 | * |
||
15 | * For use in "Last-Modified" headers. |
||
16 | * |
||
17 | * @param string $timestamp |
||
18 | * @return string|null |
||
19 | */ |
||
20 | public static function timestampToHttpDate($timestamp) |
||
27 | |||
28 | /** |
||
29 | * Convert timestamp to x unit(plural), like "6 minutes" or "1 day". |
||
30 | * |
||
31 | * @param string $timestamp |
||
32 | * @param string $lang Language |
||
33 | * @return string Formated time: "x unit(s)" or empty string |
||
34 | */ |
||
35 | public static function timeElapsed($timestamp, $lang = "en") |
||
70 | } |
||
71 |