cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar

Timestamp conversion? it just nulls out if I try to format as a timestamp

2024-01-06 13:59:00+00:00

 

I am getting timestamps in this format. JMP auto-formats them as Charact-Nominal....How do I get these to be a proper timestamp format?

2 REPLIES 2
jthi
Super User

Re: Timestamp conversion? it just nulls out if I try to format as a timestamp

Create formula column with formula

Informat(Word(1, :Column 1, "+"))

where :Column 1 is your string formatted "date". This formula will pick anything before "+" and JMP is most likely able to convert that to a numeric format (if JMP isn't able to do that, you might have to add Format pattern to Informat())

-Jarmo
hogi
Level XI

Re: Timestamp conversion? it just nulls out if I try to format as a timestamp

unfortunately, there is no placeholder available yet for timezone offsets like +00:00 

but one could hard-code the "+00:00" via

Informat( :Column 1, "Format Pattern", "<YYYY></><MM></><DD> <hh>:<mm>:<ss>+00:00" )

actually no benefit compared to Jarmos version - just a much longer code.
maybe: you can force Jmp to place DD and MM at the right position

If you want to parse input with varying timezone offset, you have to split off the timezone info and add it later:

Informat( Word( 1, :input, "+" ) ) + Num( Word( 1, Word( 2, :input, "+" ), ":" ) )
 * 60 * 60

If there are negative offsets as well, it gets harder and harder to parse.

Then you should consider this request from the wish list:Date Format Pattern - additional functionality 

and maybe support it with a Kudo  ...