cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Due to inclement weather, JMP support response times may be slower than usual during the week of January 26.
    To submit a request for support, please send email to support@jmp.com.
    We appreciate your patience at this time.
  • Register to see how to import and prepare Excel data on Jan. 30 from 2 to 3 p.m. ET.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
jfsilves
Level I

Converting Seconds since the epoch to datetime

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

Recommended Articles