Skip to main content
Question

Get FME Server Job timestamp, when queued and convert to UTC


geolassi
Contributor
Forum|alt.badge.img+5

Hello! I'm using HTTPCaller and FME Server's REST API to get a job timestamp (timeQueued), when it was sent to a queue. It's working well, but the timestamp should be converted to UTC. Currently local time in Finland is +3h from UTC, and due to the daylight saving, it goes to +2h in the fall. The job should be run automatically, so that I wouldn't need to put a offset parameter to the local time, which comes from REST API. Easiest solution would be that the timeQueued would come in UTC. Is it possible to configure that in FME Server?

3 replies

david_r
Celebrity
  • August 11, 2016

I think the easiest (only?) solution would be to set the timezone on your server to UTC and restart.

FME Server should automatically use the time zone defined on the server it is running.

You could theoretically use Python to convert the server's local time to UTC, but it get's complicated each time DST gets involved, particularly when the clock is set back and you must account for the same timestamp occurring twice in a short timeframe.


geolassi
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • August 11, 2016
david_r wrote:

I think the easiest (only?) solution would be to set the timezone on your server to UTC and restart.

FME Server should automatically use the time zone defined on the server it is running.

You could theoretically use Python to convert the server's local time to UTC, but it get's complicated each time DST gets involved, particularly when the clock is set back and you must account for the same timestamp occurring twice in a short timeframe.

I assume that means all the jobs' timestamps are in UTC then, which is a problem.

 

 


david_r
Celebrity
  • August 11, 2016
geolassi wrote:
I assume that means all the jobs' timestamps are in UTC then, which is a problem.

 

 

I'd consider the PythonCaller route, then.

 

You can use 

 

from datetime import datetime
utc_now = datetime.utcnow()
to get the local (workstation) timestamp in UTC and use that to decide how to apply DST corrections. Find the UTC timestamps when DST begins and ends in Finland (http://www.timeanddate.com/time/change/finland/helsinki) and compare utc_now with those.

 

 

David

 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings