Jump to content

Show Hours Depends On Machine Time


Manhag

Recommended Posts

yip, and when I tested it it worked for me (I am in the uk right enough...).

 

 

did you try it?

 

Also, where exactly do you think the script is getting it's time zone settings anyway? It's not going off to some NTS and pulling GMT out just to mess with you, it takes the time zone setting as whatever you set it as in the php.ini file.

You can set the script timezone like so:

 

date_default_timezone_set('America/Toronto');

$timezone = date_default_timezone_get();

echo date('c');

 

Or you can change your timezone directly in your php.ini which will affect all scripts.

 

See: http://php.net/manual/en/function.date-default-timezone-set.php and List of Supported Timezones

Try not using short open tags, and using gmdate instead of date :

gmdate('H', $min);

 

gmdate() isn't what's needed here: "Identical to the date() function except that the time returned is Greenwich Mean Time (GMT)."

gmdate() isn't what's needed here: "Identical to the date() function except that the time returned is Greenwich Mean Time (GMT)."

I only suggested it because when I tested it on y dev server date() was returing system time +1H, gmdate() returned the actual system time.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.