cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • New to JMP? Join us Sept. 23-24 for the Early User Edition of Discovery Summit, tailor-made for new users. Register now for free!
  • Your voice matters! Tell us how you prefer to receive JMP updates, so we can tailor our communication to your needs. Take short survey.
  • See how to access JMP Marketplace - and - find, create & share add-ins to extend your JMP. Watch video.

Discussions

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

Building a custom date format to include milliseconds: 2020-06-11T03:18:30.000Z

I have used the custom date format generator to produce this custom format (which does not work):

<YYYY><-><MM><-><DD><'T'><hh24><:><mm><:><ss><:><ss>

 

The format I received from Twitter has th period between seconds and hundredths, but that is not an option in the date format builder.

1 REPLY 1
jthi
Super User

Re: Building a custom date format to include milliseconds: 2020-06-11T03:18:30.000Z

The issue might be with the Z, not with milliseconds.

Names Default To Here(1);

date_str = "2020-06-11T03:18:30.123Z";
Show(Informat(date_str, "Format Pattern", "<YYYY><-><MM><-><DD><'T'><hh24><:><mm><:><ss>"));
//drop Z
date_str = Left(date_str, Length(date_str) - 1);
Show(Informat(date_str, "Format Pattern", "<YYYY><-><MM><-><DD><'T'><hh24><:><mm><:><ss>"));
date_with_ms = Format(date_formatted, "yyyy-mm-ddThh:mm:ss", 25,3);
show(date_with_ms);
-Jarmo

Recommended Articles