wordpress - Get server timezone In PHP -


my client needs system report plugin running server details, means have server timezone. working wordpress. tried on this, not working on every server.

$date = new datetime(); $date->settimezone(new datetimezone(ini_get('date.timezone'))); 

this gives me fatal error on servers, got common function server timezone?
any suggestions appreciated.

try this:

$date = new datetime(); $date = $date->gettimezone(); $date = $date->getname(); echo $date;  

Comments

Popular posts from this blog

scala - 'wrong top statement declaration' when using slick in IntelliJ -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

PySide and Qt Properties: Connecting signals from Python to QML -