| @@ -1,10 +1,13 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | +defined('ABSPATH') || die('Restricted Access'); | |
| 4 | + | |
| 3 | 5 | function acym_getTimeOffsetCMS(): int |
| 4 | 6 | { |
| 5 | 7 | static $timeoffset = null; |
| 6 | 8 | if ($timeoffset === null) { |
| 9 | + //We replace the . with : WordPress give format like UTC+5.45, but we want something like UTC+5:45 | |
| 7 | 10 | $timeoffset = str_replace('.', ':', acym_getCMSConfig('offset')); |
| 8 | 11 | |
| 9 | 12 | if (!is_numeric($timeoffset)) { |
| 10 | 13 | $timezone = new DateTimeZone($timeoffset); |
| @@ -16,9 +19,9 @@ | ||
| 16 | 19 | } |
| 17 | 20 | |
| 18 | 21 | function acym_dateTimeCMS(int $time) |
| 19 | 22 | { |
| 20 | - return date('Y-m-d H:i:s', $time); | |
| 23 | + return gmdate('Y-m-d H:i:s', $time); | |
| 21 | 24 | } |
| 22 | 25 | |
| 23 | 26 | function acym_getDateTimeFormat(string $default = ''): string |
| 24 | 27 | { |