- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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