Forum Discussion

gutovanzin's avatar
gutovanzin
Frequent Visitor
5 years ago
Solved

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...
  • edhans's avatar
    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.