문제

We have a WAMP server running on America/New_York time and a Scheduled task that runs every day at 1.30AM local time or 5.30GMT (6.30 BST).

It ran this morning (8/4/14) but running "date('Y-m-d')" outputs '2014-04-07' even though the unix timestamp is 1396935011 (Tue, 08 Apr 2014 05:30:11 GMT).

What on earth am I missing? Why would it daily tell us it is run the day before even though I know that it definitely hasn't.

Thanks

A

도움이 되었습니까?

해결책

If you are running a scheduled task, can I assume you mean you run a PHP CLI script from Task Scheduler?

If so you will also have to make the timezone change to the \wamp\bin\php\php5.x.y\php.ini file so that the CLI also knows that it is running in the New_York time zone.

date.timezone = "America/New_York"
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top