Copybara bot | be50d49 | 2023-11-30 00:16:42 +0100 | [diff] [blame] | 1 | <?php |
2 | class common { | ||||
3 | public static function getDayTimestamp($originaltime) { | ||||
4 | $datetime = new DateTime(); | ||||
5 | $datetime->setTimestamp($originaltime); | ||||
6 | |||||
7 | $rawdate = $datetime->format("Y-m-d")."T00:00:00"; | ||||
8 | $date = new DateTime($rawdate); | ||||
9 | |||||
10 | return $time = $date->getTimestamp(); | ||||
11 | } | ||||
12 | |||||
13 | public static function getTimestampFromRFC3339($rfc) { | ||||
14 | $date = new DateTime($rfc); | ||||
15 | return (int)$date->getTimestamp(); | ||||
16 | } | ||||
17 | } |