blob: 26d02aab708f9e008e621a0f7ba187f045791d66 [file] [log] [blame]
Copybara botbe50d492023-11-30 00:16:42 +01001<?php
2class 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}