I have a number 1576742379172. I want to input this to get the output as Date and Time.

I have a number 1576742379172. I want to input this to get the output as Date and Time. Please help.

  Discussion posts and replies are publicly visible

Parents Reply
  • Ok, so I think it'll something like this:

    a!localVariables(
      local!epochTime: ri!epochTime,
      local!baseDate: todatetime("1/1/1970"),
      local!baseDate + (local!epochTime / (1000*60*60*24))
    )

    Inputting the value you provided (1576742379172) returns 12/19/2019 7:59 AM GMT+00:00 (you'll have to tell me if you think that's the correct datetime value)

    The principle here is that I've taken the value you provided, divided by 1000 (because it's milliseconds) and then divided by 60 (to get minutes), then 60 again (to get hours) and then 24 (to get days) and then simply added those days to the base of 1/1/1970

Children