cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP will suspend normal business operations for our Winter Holiday beginning on Wednesday, Dec. 24, 2025, at 5:00 p.m. ET (2:00 p.m. ET for JMP Accounts Receivable).
    Regular business hours will resume at 9:00 a.m. EST on Friday, Jan. 2, 2026.
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
Damian
Level I

Parsing datetime information + conversion with milliseconds

I am new to JMP and I am trying to batch process many .csv files. My first hiccup is happening when I try to pull datetime information from the first column.My data table looks like 

Damian_0-1605745343072.png

 As you can see from the picture, each row of timestamps has an unwanted "-0800" tacked on the end How would I get rid of this for each entry? The jsl syntax I used looks something like

 

:loggingTime = Substr( :loggingTime , 1 ,  23)

 

However when I run this, I just end up with an empty column. Lastly, I know to ultimately format the string into a datetime object I will need the "informat" command  but my question there is can I select a format that records milliseconds and that doesnt just stop at seconds? I know this is simple stuff but as I said I am new to JSL and any help would be greatly appreciated.

 

1 REPLY 1
txnelson
Super User

Re: Parsing datetime information + conversion with milliseconds

if you run this script, it should fix your LogingTime data

Names default to here(1);
For Each Row(
     :loggingTime = Substr( :loggingTime, 1, 23 );
);

Formats will automatically loop through each row, but scripts require one to do the looping within the script.

Concerning your informat issue....Here is a format that if you create a new column, and specify the below as the format, it will convert your LoggingTime to a JMP date time value.  All you need to do then, is to specify the DateTime format you want to use for the displaying of the value

num(format(informat(date,"yyyy-mm-dd h:m:s"),"fixed dec",23,3))
Jim

Recommended Articles