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.
Get the free JMP Student Edition for qualified students and instructors at degree granting institutions.
Choose Language Hide Translation Bar
View Original Published Thread

how to change a series of numbers into time format

SuperBigRabbit
Level I

Hello! 

 

Can anybody help changing a series of numbers into time format [hh:mm:ss] here. 

Originally, the data type is character. So, I've tried changing the data type from character to numeric to set format as [hh:mm:ss] but I failed...

I have no idea what to do now. 

What I'd like to see as a result is, taking an example of 000003, 00:00:03..

It should not be that difficult, but I can't find a way...

 

And here's the data I'm dealing with now. 

[column1] Original Date => [column2] After changing data type from character to numeric ==> [column3] After setting time format   

 

SuperBigRabbit_1-1662617069583.png

 

Thank you in advance

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User


Re: how to change a series of numbers into time format

If I understand the "original" format correctly, one option would be to first convert first column to seconds by using formula like:

Num(Left(:Column 1, 2))*60*60 + Num(Substr(Column 1, 3, 2))*60 + Num(Right(Column 1,2));

jthi_0-1662620393510.png

and then convert that to duration format

jthi_1-1662620408526.png

 

-Jarmo

View solution in original post

3 REPLIES 3
jthi
Super User


Re: how to change a series of numbers into time format

If I understand the "original" format correctly, one option would be to first convert first column to seconds by using formula like:

Num(Left(:Column 1, 2))*60*60 + Num(Substr(Column 1, 3, 2))*60 + Num(Right(Column 1,2));

jthi_0-1662620393510.png

and then convert that to duration format

jthi_1-1662620408526.png

 

-Jarmo
Georg
Level VII


Re: how to change a series of numbers into time format

Another possibility is using informat:

Georg_0-1662638878712.png

 

Georg


Re: how to change a series of numbers into time format

 This totally solved the issue. 

Thank you a lot!