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
WHG
WHG
Level I

Convert character timestamp to typical numeric format

I would like to convert a character timestamp format like this one:

06/28/19 11:26:29:252

to a typical numeric format

06/28/19 11:26:29

Any help much appreciated.

7 REPLIES 7
johnmoore
Level IV

Re: Convert character timestamp to typical numeric format

Give this a try

characterStamp = "06/28/19 11:26:29:252";

lastPart = ":"||word(4,characterStamp,":");
substituteinto(characterStamp,lastPart,"");

numberStamp = informat(characterStamp,"m/d/y h:m:s")
WHG
WHG
Level I

Re: Convert character timestamp to typical numeric format

How do I apply the script to convert the old format to the new format, let's say for all values from column 1 to column 2?

txnelson
Super User

Re: Convert character timestamp to typical numeric format

The easiest way to do this is to right click on the column header for Column 2 and select "Formula".

Then place the following into the formula window

characterStamp = :column 1;
lastPart = ":"||word(4,characterStamp,":");
substituteinto(characterStamp,lastPart,"");

informat(characterStamp,"m/d/y h:m:s")
Jim
WHG
WHG
Level I

Re: Convert character timestamp to typical numeric format

This leads to this:

Capture.PNG

Any help much appreciated.

johnmoore
Level IV

Re: Convert character timestamp to typical numeric format

Almost there. Just change the format of the column to the date/time format you want.
WHG
WHG
Level I

Re: Convert character timestamp to typical numeric format

Fantastic. Thank you!

Jeff_Perkinson
Community Manager Community Manager

Re: Convert character timestamp to typical numeric format

Recommended Articles