Jump to content

Recommended Posts

Posted

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.

Posted (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 by Krydos
swapping E and P
Posted

Thanks very much for fast answer :)

I wasn't sure about the time, because both phpinfo() and time() was showing me the UTC time.

Posted

In php you have to use the function

date_default_timezone_set("America/New_York");
before you use the time. Cron runs on local time.
Posted (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 by krkruk
Posted

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 :)

Posted

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.

  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...