krkruk Posted November 8, 2017 Share Posted November 8, 2017 Hi, I've just started using the Helio server. So far, everything looks nice.However, I want to use the hosting to create a CRON job, which would collect some stats once a day for a server which is in EST/EDT timezone.I'de like to ask, what time in CRON settings should I use, to run it at 23:59 that server time?Also, will the settings hold after the time for the timezone will change from EST to EDT and vice versa?I'm on the johnny server, if that matters. Quote Link to comment Share on other sites More sharing options...
Krydos Posted November 8, 2017 Share Posted November 8, 2017 (edited) 23:59 PST/PDT would be 02:59 EST/EDT. Yes, the cron should continue to execute at the right time during daylight savings changes. Edited November 12, 2017 by Krydos swapping E and P Quote Link to comment Share on other sites More sharing options...
krkruk Posted November 8, 2017 Author Share Posted November 8, 2017 Thanks very much for fast answer I wasn't sure about the time, because both phpinfo() and time() was showing me the UTC time. Quote Link to comment Share on other sites More sharing options...
Krydos Posted November 8, 2017 Share Posted November 8, 2017 In php you have to use the functiondate_default_timezone_set("America/New_York"); before you use the time. Cron runs on local time. Quote Link to comment Share on other sites More sharing options...
krkruk Posted November 8, 2017 Author Share Posted November 8, 2017 (edited) Ok, cool. Though, the time will only be needed to start the cron job. From PHP there will be just a couple of JSON requests started from the job and several dozens of responses a day to a TamperMonkey script. I just needed the start time, because after midnight stats for a current day on the server (EyeWire) are reset. Edited November 8, 2017 by krkruk Quote Link to comment Share on other sites More sharing options...
krkruk Posted November 11, 2017 Author Share Posted November 11, 2017 For potential future readers: 23:59 EST/EDT would be 02:59 PST/PDT.After some testing (and looking at a map xD), it's actually the other way around - 02:59 EST/EDT would be 23:59 PST/PDT, so the setting from the title should be 20:59.Nonetheless, the PHP timezone setting function turned out to be quite useful Quote Link to comment Share on other sites More sharing options...
Krydos Posted November 12, 2017 Share Posted November 12, 2017 Rereading my post that's totally what I meant to say. Thanks for pointing it out. These forums are a great source of information for people who have the same issue in the future to search and find their answers, but it's best if the information is correct. I edited my post. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.