mirror of
https://github.com/opensupports/opensupports.git
synced 2025-07-31 01:35:15 +02:00
Ivan - Fix dates [skip ci]
This commit is contained in:
parent
661e9c396b
commit
9d8c1a6225
@ -55,4 +55,6 @@ foreach (glob('controllers/*.php') as $controller) {
|
||||
include_once $controller;
|
||||
}
|
||||
|
||||
Date::setTimeZone();
|
||||
|
||||
$app->run();
|
||||
|
@ -1,5 +1,21 @@
|
||||
<?php
|
||||
class Date {
|
||||
public static function setTimeZone() {
|
||||
$timezone = Setting::getSetting('time-zone');
|
||||
|
||||
if(!$timezone->isNull()) {
|
||||
$timezone = $timezone->getValue();
|
||||
|
||||
if($timezone > 0) {
|
||||
date_default_timezone_set('GMT+' . $timezone);
|
||||
} else if($timezone == 0) {
|
||||
date_default_timezone_set('GMT');
|
||||
} else {
|
||||
date_default_timezone_set('GMT-' . abs($timezone * 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static function getCurrentDate() {
|
||||
return date('YmdHi');
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user