Skip to main content
Best answer by rolands0008

Since a Unix timestamp is the number of seconds from 01/01/1970 till now, you can try something like this:

(1651670870 / 86400) + datetime(1970, 01, 01, 00, 00)

9 replies

May 4, 2022

Since a Unix timestamp is the number of seconds from 01/01/1970 till now, you can try something like this:

(1651670870 / 86400) + datetime(1970, 01, 01, 00, 00)

mikes0011
Brainy
May 4, 2022

I was going to suggest the intervalds() function, but upon testing it appears to not like large values for seconds.

That said, the seconds() function appears to work here, too, if it helps anyone simplify things slightly.

datetime(1970, 1, 1, 00, 00) + second() * 1651670870

Edit to add: I never realized there's an addSeconds() function too.  Maybe it's newer?  (edit: it's from a plug-in, thanks Richard)

addseconds(datetime(1970, 1, 1, 00, 00), 1651670870)

The Expression Guru
richardm900458
May 4, 2022

sure "addSeconds() " is an official appian function and no plugin function?
Edit: aaah found it: https://community.appian.com/b/appmarket/posts/date-and-time-utilities

richardm900458
May 4, 2022

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 

davel001150
May 4, 2022

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).

mikes0011
Brainy
May 4, 2022
(don't watch if you can avoid)

lol, it's a good show though!

The Expression Guru
richardm900458
May 4, 2022

Use the following plugin:
https://community.appian.com/b/appmarket/posts/date-and-time-utilities
It has two new functions:

  • toUnixTimestamp - Returns the Unix timestamp from datetime
  • fromUnixTimestamp - Returns a Date and Time value by converting a Unix timestamp.