Forum Discussion

netwire's avatar
netwire
Frequent Visitor
10 years ago
Solved

Converting Unix timestamp from Stripe API to Date/Time

Hi, Is there a way that I can convert the `created` attribute of a Stripe `charge` object to Date/Time? It's currently in text format as a Unix timestamp, i.e.: 1463948811, see example here https://...
  • Greg_Deckler's avatar
    10 years ago

    Well, if it is a Unix timestamp, then it is the number of seconds from 1/1/1970 (UTC). So something like this calculated column should suffice:

     

    UTCTime = VAR UnixDays = [UnixTime]/(60*60*24)
    RETURN (DATEVALUE("1/1/1970")+UnixDays)

    Basically, convert the number of seconds to the number of days and then add it to the date value of 1/1/1970. Essentially, the same thing you would do in Excel.