(Migrated) Scheduler uses UTC time, not local

(This message has been automatically imported from the retired mailing list)

Hi all,

I have scheduled several jobs using the Zato UI and cron syntax, and they
seem to be triggering several hours earlier than the cron definition. In
fact, they are off exactly by 4 hours, which would equate to Zato using UTC
time instead of my local time.

I couldn’t find this anywhere in the docs, so does Zato use local or UTC?
Is there a way to configure this? The server is Ubuntu and outputs the
correct local time using the ‘date’ command.

Thank you Brian, I shall Google harder next time! I am ashamed!

On Thu, Mar 19, 2015 at 10:42 AM, Brian Candler b.candler@pobox.com wrote:

On 19/03/2015 14:05, Rostislav Tsiomenko wrote:

I couldn’t find this anywhere in the docs, so does Zato use local or UTC?

Google “zato utc”, third hit:
https://zato.io/docs/public-api/intro.html

“All date and datetime objects are always in UTC. Internally, Zato servers
never use any other time zone thus one always needs to convert the user
input from their local TZ to UTC.”

Regards,

Brian.

Carles,

Thanks for your reply, I did find that setting and carried out some tests.
Unfortunately you’re right, 2.0.X still uses UTC for cron-style scheduler
jobs, so I will have to use UTC. Thanks again everyone.

On Thu, Mar 19, 2015 at 11:02 AM, Coeuz coeuz@coeuz.net wrote:

Hello,

Zato accepts per-user timezone configuration for all GUI features:
https://zato.io/docs/2.0/web-admin/settings/main.html

And, as far as I remember, this includes Scheduler configuration, which
means that if you specify your timezone in this settings you won’t need
to translate any datetimes into UTC.

However, if this hasn’t changed in 2.0.X (I only used the scheduler in
1.1) I think that this is only considered in the “one-time” or
"interval-based" jobs, while the “cron-style” use UTC.

Regards,
Carles

El 19/03/15 a les 15:42, Brian Candler ha escrit:

On 19/03/2015 14:05, Rostislav Tsiomenko wrote:

I couldn’t find this anywhere in the docs, so does Zato use local or
UTC?
Google “zato utc”, third hit:
https://zato.io/docs/public-api/intro.html

“All date and datetime objects are always in UTC. Internally, Zato
servers never use any other time zone thus one always needs to convert
the user input from their local TZ to UTC.”

Regards,

Brian.

Dariusz,

Yes, it is a little inconsistent, and since UTC does not observe DTC, this
means that, if jobs were scheduled in UTC to run at a specific time in a
local timezone, for example, EST (which is my timezone), one would have to
adjust them every time Daylight Savings Time changed the local time.

Here is what I tested:

  • Local time was 11:05
  • I changed the UI setting to EST and created a cron-style job for '10 11 *
  • *’
  • Waited until 11:10, job did not trigger
  • Changed job definition to ‘15 15 * * *’
  • Job triggered at 11:15, as expected for the EST timezone. This is also
    consistent with all the jobs I’ve tried to schedule so far - they all
    executed in UTC time.

So, not a big problem, I’ve found a workaround for now - just something
think about. Thanks!

On Thu, Mar 19, 2015 at 12:52 PM, Dariusz Suchojad dsuch@zato.io wrote:

On 19/03/15 16:15, Rostislav Tsiomenko wrote:

Thanks for your reply, I did find that setting and carried out some
tests. Unfortunately you’re right, 2.0.X still uses UTC for cron-style
scheduler jobs

Hi Rostislav,

this should be considered as something to amend then - all types of
scheduler’s jobs should work consistently.

Can you please send in a couple of cron definitions you tested it with?

Brian is correct that internally everything is in UTC but from the
user’s viewpoint, everyone can use their own preferred TZ in GUI.

If I am UTC+10 and you are UTC+4 the jobs should still run at the same
time and you shouldn’t set your TZ to UTC if it’s not what you prefer to
use on frontend.

thanks,


Dariusz Suchojad

https://zato.io
ESB, SOA, REST, APIs and Cloud Integrations in Python

On 19/03/2015 14:05, Rostislav Tsiomenko wrote:

I couldn’t find this anywhere in the docs, so does Zato use local or UTC?
Google “zato utc”, third hit:
https://zato.io/docs/public-api/intro.html

“All date and datetime objects are always in UTC. Internally, Zato
servers never use any other time zone thus one always needs to convert
the user input from their local TZ to UTC.”

Regards,

Brian.

Hello,

Zato accepts per-user timezone configuration for all GUI features:
https://zato.io/docs/2.0/web-admin/settings/main.html

And, as far as I remember, this includes Scheduler configuration, which
means that if you specify your timezone in this settings you won’t need
to translate any datetimes into UTC.

However, if this hasn’t changed in 2.0.X (I only used the scheduler in
1.1) I think that this is only considered in the “one-time” or
"interval-based" jobs, while the “cron-style” use UTC.

Regards,
Carles

El 19/03/15 a les 15:42, Brian Candler ha escrit:

On 19/03/2015 14:05, Rostislav Tsiomenko wrote:

I couldn’t find this anywhere in the docs, so does Zato use local or UTC?
Google “zato utc”, third hit:
https://zato.io/docs/public-api/intro.html

“All date and datetime objects are always in UTC. Internally, Zato
servers never use any other time zone thus one always needs to convert
the user input from their local TZ to UTC.”

Regards,

Brian.