<![CDATA[ Time zone issue - MODX Community Forums]]> https://forums.modx.com/thread/?thread=103952 <![CDATA[Time zone issue]]> https://forums.modx.com/thread/103952/time-zone-issue#dis-post-559059
I have a page which publishes a resource at a specific time each week.

I'm in the UK and we are currently on British Summer Time.

So if I want the resource to get published at 5pm, i need to set the publish time at 4pm.
I've checked my server, and it knows that the time is 5pm, but if I add this to my page:
[[!+nowdate:default=`now`:strtotime:date=`%c`]]


It print the time as being 4pm!

In system settings there are two settings:
Default Time Zone: date_timezone
Server offset time: 0


I tried changing the server offset time to 1 to correct it, but this seems to do nothing.
Even if it DID work, it's not a good solution, because I would have to remember to change it back when the clocks go back or forward (twice a year).

Any ideas why it's showing a different time to the server time?


Thanks!
Andy

]]>
tm2000 Jun 13, 2018, 04:17 PM https://forums.modx.com/thread/103952/time-zone-issue#dis-post-559059
<![CDATA[Re: Time zone issue]]> https://forums.modx.com/thread/103952/time-zone-issue#dis-post-559094 Quote from: BobRay at Jun 14, 2018, 09:45 PM
Sorry, I mis-wrote. I meant what timezone PHP thinks it is, not what time.

Glad you got it sorted. smiley

Ah Ok - thanks Bob!]]>
tm2000 Jun 15, 2018, 09:12 AM https://forums.modx.com/thread/103952/time-zone-issue#dis-post-559094
<![CDATA[Re: Time zone issue]]> https://forums.modx.com/thread/103952/time-zone-issue#dis-post-559087
Glad you got it sorted. smiley]]>
BobRay Jun 14, 2018, 09:45 PM https://forums.modx.com/thread/103952/time-zone-issue#dis-post-559087
<![CDATA[Re: Time zone issue]]> https://forums.modx.com/thread/103952/time-zone-issue#dis-post-559074 Quote from: BobRay at Jun 13, 2018, 09:42 PM
Try setting the date_timezone System Setting to "Europe/London" (without the quotes).

If that doesn't do it, try adding this line to a php.ini file in the MODX root (create one if necessary):

date.timezone = "Europe/London"


If that doesn't work, check the Date section of PhpInfo() (Manage -> Reports -> System Information -> phpinfo() link) to see what time PHP thinks it is.


Thanks Bob. The first option worked by setting the date_timezone System Setting to "Europe/London"
So thank you for that! (I always assumed it would inherit the timezone et by the server)

I have had a look at the pInfo() within reports, but all I can find is under Date it says 'Default timezone Europe/London'
I can't find anywhere where it prints what time it thinks it is.

But the main thing is that your first solution worked. so thank you!

Andy
]]>
tm2000 Jun 14, 2018, 07:53 AM https://forums.modx.com/thread/103952/time-zone-issue#dis-post-559074
<![CDATA[Re: Time zone issue]]> https://forums.modx.com/thread/103952/time-zone-issue#dis-post-559071 nuan88 Jun 13, 2018, 09:49 PM https://forums.modx.com/thread/103952/time-zone-issue#dis-post-559071 <![CDATA[Re: Time zone issue (Best Answer)]]> https://forums.modx.com/thread/103952/time-zone-issue#dis-post-559065
If that doesn't do it, try adding this line to a php.ini file in the MODX root (create one if necessary):

date.timezone = "Europe/London"


If that doesn't work, check the Date section of PhpInfo() (Manage -> Reports -> System Information -> phpinfo() link) to see what time PHP thinks it is.

]]>
BobRay Jun 13, 2018, 09:42 PM https://forums.modx.com/thread/103952/time-zone-issue#dis-post-559065