cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Register to attend Discovery Summit 2025 Online: Early Users Edition, Sept. 24-25.
  • New JMP features coming to desktops everywhere this September. Sign up to learn more at jmp.com/launch.
Choose Language Hide Translation Bar
mvanderaa1
Level IV

Datetime format confusion (looking for equivalent of python's datetime.strptime)

I'm sure this has been asked many times, but I did not find a good solution.

I have a column (let's call it time_col) with a timestamp in the format 2024-06-28T13:47:03

 

Looking at the documentation I figured I should use Format, something like:

Format(:time_col, "Format Pattern", "<YYYY><-><MM><-><DD><T><hh><:><mm><:><ss>" )

 

But this does not give any result.

In python it would be:

datestr = '2024-06-28T13:47:03'
datetime_object = dt.strptime(datestr, '%Y-%m-%dT%H:%M:%S')

hope someone can help me out

2 REPLIES 2
mvanderaa1
Level IV

Re: Datetime format confusion (looking for equivalent of python's datetime.strptime)

I see now that this format is actually supported by JMP. I didn't find it because I was looking for a date format while my data type was set to "character" instead of "numeric".

 

I suppose my question is still valid for other string formats though.

txnelson
Super User

Re: Datetime format confusion (looking for equivalent of python's datetime.strptime)

JMP has a built in format for this time structure.  Use

informat(:timeEcol,"yyyy-mm-ddThh:mm:ss")
Jim

Recommended Articles