Convert character timestamp to typical numeric formatI 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.
Re: Convert character timestamp to typical numeric formatGive 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")
Re: Convert character timestamp to typical numeric formatHow 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?
Re: Convert character timestamp to typical numeric formatThe 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")
Re: Convert character timestamp to typical numeric formatThis leads to this:

Any help much appreciated.
Re: Convert character timestamp to typical numeric formatAlmost there. Just change the format of the column to the date/time format you want.Re: Convert character timestamp to typical numeric formatFantastic. Thank you!
Re: Convert character timestamp to typical numeric formatYou may find value in Using dates, times, datetimes and durations in JMP.