Seconds bewteen timestamps?

Post your questions and help other users.

Moderator: Martin

Post Reply
Wibbly
Posts: 418
Joined: 17 Mar 2014 09:02

Seconds bewteen timestamps?

Post by Wibbly » 07 Feb 2016 11:28

What would be the most appropriate script formula to obtain a timestamp measured in seconds from getDate()?

I want to measure a time interval to the nearest second and don't want to be concerned with hour/minute/day boundaries. So seconds since some arbitary fixed date/time in the past would work.

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Seconds bewteen timestamps?

Post by Martin » 07 Feb 2016 19:50

All built-in dates in Automagic are just the number of milliseconds since 1970. getDate() also returns the time in milliseconds since 1970, so you could use it and divide by 1000 if you don't need the millisecond precision.

Wibbly
Posts: 418
Joined: 17 Mar 2014 09:02

Re: Seconds bewteen timestamps?

Post by Wibbly » 07 Feb 2016 20:34

Ah. Very simple, thanks :)

Post Reply