Share your ideas for the JMP Scripting Unsession at Discovery Summit by September 17th. We hope to see you there!
Choose Language Hide Translation Bar
Highlighted
KellyT
Level II

Parsing Datetime with symbols

Dear community:

 

I am having trouble to find a good solution to parse Datetime examples below by changing the "Format" (under "Column Info"):

2018-01-01 14:44:19.290000+00:00

2018-01-01 13:43:40.090000+00:00

 

Currently, I have to use Regex to find the pattern after the period and then replace it with blank.  I am hoping that there is an easy option.

 

Thank you for your help!

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: Parsing Datetime with symbols

I don't know if this result is quite what you want but it is simple.

 

table.JPG

 

I used this formula in another column and left the original alone.

 

Informat( Substitute( Word( 1, :Date Time String, "+" ), " ", "T" ), "yyy-mm-dd" )
Learn it once, use it forever!

View solution in original post

3 REPLIES 3
Highlighted
Jeff_Perkinson
Community Manager Community Manager

Re: Parsing Datetime with symbols

Again, my favorite function comes the rescue.  Word(), using "+" as the delimiter can give you the bit before the plus. Then you can use Informat() to convert it to a date value. Informat(), without a second argument, will let JMP figure out the format on it's own if it can.

 

2020-08-13_12-38-41.531.png

Read more about these two topics:

If you learn only one Formula Editor function, Word() is the one 

Using dates, times, datetimes and durations in JMP 

 

 

-Jeff
Highlighted

Re: Parsing Datetime with symbols

I don't know if this result is quite what you want but it is simple.

 

table.JPG

 

I used this formula in another column and left the original alone.

 

Informat( Substitute( Word( 1, :Date Time String, "+" ), " ", "T" ), "yyy-mm-dd" )
Learn it once, use it forever!

View solution in original post

Highlighted
Craige_Hales
Staff (Retired)

Re: Parsing Datetime with symbols

The T format is really useful for exchanging date time values, even if it is a bit ugly.

https://en.wikipedia.org/wiki/ISO_8601#Combined_date_and_time_representations 

Craige
Article Labels

    There are no labels assigned to this post.