Forum Discussion

SaurabhDedhia's avatar
SaurabhDedhia
Qrew Member
5 years ago

Date / Time to Epoch Milliseconds

Is there a way to convert Date / Time to Epoch Milliseconds ?

I want to use it in my webhook message body like this :
{
"epoch_date_created" : [Date Created]
}

But [Date Created] returns something like 03-06-2020 12:03 PM

------------------------------
Saurabh Dedhia
------------------------------
  • PaulPeterson1's avatar
    PaulPeterson1
    Qrew Assistant Captain
    Try this:

    ToMSeconds([Date Created] - ToTimestamp(ToDate("1/1/1970"), ToTimeOfDay("00:00:00")))

    ------------------------------
    Paul Peterson
    ------------------------------
    • PaulPeterson1's avatar
      PaulPeterson1
      Qrew Assistant Captain
      Remove the "M" from the formula and you will get the results you're looking for:

      ToSeconds([Date Created] - ToTimestamp(ToDate("1/1/1970"), ToTimeOfDay("00:00:00")))

      ------------------------------
      Paul Peterson
      ------------------------------