Monday, 17 June 2019

Create UNIX timestamp for ArcGIS Server Feature REST API

When you feed or update datetime column in ArcGIS REST API the current date and time has to be in UNIX epoch milliseconds.

In Python this is the easiest way to do:

int(time.time())*1000
The *1000 is required to get the milliseconds from the seconds. Obviously this way is only accurate to the second...if you want to gain more precision you should perhasp go with this:
float(time.time())*1000
With this methodology you will not loose the milliseconds due to integer rounding.

No comments:

Post a Comment