diff --git a/api/runtime.php b/api/runtime.php index 6feeb6c..8efe3c7 100644 --- a/api/runtime.php +++ b/api/runtime.php @@ -829,13 +829,13 @@ class runtime extends cora\api { * * @return string The UTC datetime string. */ - private function get_utc_datetime($local_datetime, $local_time_zone) { + private function get_utc_datetime($local_datetime, $local_time_zone, $format = 'Y-m-d H:i:s') { $local_time_zone = new DateTimeZone($local_time_zone); $utc_time_zone = new DateTimeZone('UTC'); $date_time = new DateTime($local_datetime, $local_time_zone); $date_time->setTimezone($utc_time_zone); - return $date_time->format('Y-m-d H:i:s'); + return $date_time->format($format); } /** @@ -846,13 +846,13 @@ class runtime extends cora\api { * * @return string The UTC datetime string. */ - private function get_local_datetime($utc_datetime, $local_time_zone) { + private function get_local_datetime($utc_datetime, $local_time_zone, $format = 'Y-m-d H:i:s') { $local_time_zone = new DateTimeZone($local_time_zone); $utc_time_zone = new DateTimeZone('UTC'); $date_time = new DateTime($utc_datetime, $utc_time_zone); $date_time->setTimezone($local_time_zone); - return $date_time->format('Y-m-d H:i:s'); + return $date_time->format($format); } /**