added time zone setting to server profile
This commit is contained in:
parent
5930ef17b5
commit
75b59ce12d
|
@ -917,8 +917,10 @@ function compareDN(&$a, &$b) {
|
||||||
* @return String formated time
|
* @return String formated time
|
||||||
*/
|
*/
|
||||||
function formatLDAPTimestamp($time) {
|
function formatLDAPTimestamp($time) {
|
||||||
return substr($time, 6, 2) . '.' . substr($time, 4, 2) . '.' . substr($time, 0, 4) .
|
$timeNumbers = substr($time, 0, -1);
|
||||||
' ' . substr($time, 8, 2) . ':' . substr($time, 10, 2) . ':' . substr($time, 12, 2) . ' GMT';
|
$dateTime = DateTime::createFromFormat('YmdHis', $timeNumbers, new DateTimeZone('UTC'));
|
||||||
|
$dateTime->setTimezone(getTimeZone());
|
||||||
|
return $dateTime->format('d.m.Y H:i:s');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1267,4 +1269,14 @@ function getTimeZoneOffsetHours() {
|
||||||
return round($dtz->getOffset(new DateTime('UTC')) / 3600);
|
return round($dtz->getOffset(new DateTime('UTC')) / 3600);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the configured time zone.
|
||||||
|
*
|
||||||
|
* @return DateTimeZone time zone
|
||||||
|
*/
|
||||||
|
function getTimeZone() {
|
||||||
|
$timeZone = $_SESSION['config']->getTimeZone();
|
||||||
|
return new DateTimeZone($timeZone);
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
Loading…
Reference in New Issue