Skip to main content
Question

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

  • August 11, 2016
  • 3 replies
  • 41 views

geolassi
Contributor
Forum|alt.badge.img+7

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?

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

3 replies

david_r
Celebrity
  • 8394 replies
  • 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+7
  • Author
  • Contributor
  • 48 replies
  • 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.

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

 

 


david_r
Celebrity
  • 8394 replies
  • August 11, 2016
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