convert a Unix timestamp to DateTime

Certified Associate Developer

How can I convert a Unix timestamp to DateTime?

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Senior Developer

    Hello Ernesto,
    sounds stupid but you caculate it
    Unix time is basically a time difference. 
     This count starts at the Unix Epoch on January 1st, 1970 at UTC

    We are around at unix timestamp of 1651674100 currently

    So 1651674100/3600 = is the amount of hours
    A Years is 1651674100/ 31556926 is the amount of years
    https://www.unixtimestamp.com/

    perhaps somebody has a suitable formula available. but basically you calculate what your number means as time difference 

  • 0
    Certified Lead Developer
    in reply to Richard Michaelis

    Lets see if we can work out the math ourselves.

    So unix timestamp is seconds since 1970.  Appian timestamp is DAYS since 2035 (so it's actually a negative number that keeps diminishing for now).

    Perhaps what you do is convert seconds to days, so Unix timestamp / ( 3600 times 24).  That gives you days since 1970 and Appian has days since 2035.  Simple addition or subtraction should get you from there.

    You can do lots of things to calculate it.  One time, I said, "Duh, 525600 minutes!", and my friend sitting next to me said, "Did you just use the RENT method?"  I did.  I remembered that song from RENT (don't watch if you can avoid).

Reply
  • 0
    Certified Lead Developer
    in reply to Richard Michaelis

    Lets see if we can work out the math ourselves.

    So unix timestamp is seconds since 1970.  Appian timestamp is DAYS since 2035 (so it's actually a negative number that keeps diminishing for now).

    Perhaps what you do is convert seconds to days, so Unix timestamp / ( 3600 times 24).  That gives you days since 1970 and Appian has days since 2035.  Simple addition or subtraction should get you from there.

    You can do lots of things to calculate it.  One time, I said, "Duh, 525600 minutes!", and my friend sitting next to me said, "Did you just use the RENT method?"  I did.  I remembered that song from RENT (don't watch if you can avoid).

Children