cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
The Discovery Summit 2025 Call for Content is open! Submit an abstract today to present at our premier analytics conference.
See how to use to use Text Explorer to glean valuable information from text data at April 25 webinar.
Choose Language Hide Translation Bar
View Original Published Thread

Converting Seconds since the epoch to datetime

jfsilves
Level I

I have a column of data representing datetime stamps that is stored in seconds since the epoch (1 Jan 1970). 

 

How can I make JMP interpret these integers as datetime stamps?

1 ACCEPTED SOLUTION

Accepted Solutions
Jeff_Perkinson
Community Manager Community Manager


Re: Converting Seconds since the epoch to datetime

You'll need to add 01Jan1970 to each of those.

 

You can use  01Jan1970 as an unquoted constant to do that.

 

For example:

 

today70=1583246337; //03Mar2020 in seconds since 01Jan1970;

today_jmp=today70 + 01Jan1970; //add number of seconds from 01Jan1904

format(today_jmp, "mm/dd/yyyy");

Results:

 

/*:

"03/03/2020"

Note: you can use any date, not just 01Jan1970, as a constant like that.

-Jeff

View solution in original post

2 REPLIES 2
Jeff_Perkinson
Community Manager Community Manager


Re: Converting Seconds since the epoch to datetime

You'll need to add 01Jan1970 to each of those.

 

You can use  01Jan1970 as an unquoted constant to do that.

 

For example:

 

today70=1583246337; //03Mar2020 in seconds since 01Jan1970;

today_jmp=today70 + 01Jan1970; //add number of seconds from 01Jan1904

format(today_jmp, "mm/dd/yyyy");

Results:

 

/*:

"03/03/2020"

Note: you can use any date, not just 01Jan1970, as a constant like that.

-Jeff
Jeff_Perkinson
Community Manager Community Manager


Re: Converting Seconds since the epoch to datetime

Also, you'll find more information about this topic in Using dates, times, datetimes and durations in JMP

-Jeff