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
Post a Comment