Forum Discussion
gutovanzin
5 years agoFrequent Visitor
Get current time in UNIX timestamp
Hello! I created a blank Query that returns the current date and time in ISO format. = DateTimeZone.SwitchZone(DateTimeZone.LocalNow(),-3,0)
Returns: 2021-01-13T16:03:28.8506372-03:00 Is i...
- 5 years ago
Try this gutovanzin
= Duration.TotalSeconds(DateTime.LocalNow() - #datetime(1970,1,1,0,0,0))It simply gives you the total seconds from Jan 1, 1970 at midnight through now. Replace my DateTime.LocalNow() with your DateTimeZone.SwitchZone() function and it will work just fine.
You can round that with Number.Round if you don't need all of the decimals.
edhans
5 years agoCommunity Champion
gutovanzin - I have written a more complete article on this at my blog site. It won't go live until 9am Pacific on Friday, Jan 15 though. But you can see it then. In the mean time, if you have any questions let me know. Otherwise if you could give thumbs up to any posts that have helped and mark one or more as the solution so this thread can be known to be solved it would be appreciated.