cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

Is it possible to format date with milliseconds in TWX?

aelgov
1-Newbie

Is it possible to format date with milliseconds in TWX?

Hi,

I tried many options - none works, is there any quick way without parsing it manually?

DateString = "2017-02-20 15:04:39.543"

Option 1:

var sdf = "yyyy-MM-dd HH:mm:ss.sss";

var dateValue = parseDate(DateString, sdf);

Option 2:

var sdf = "yyyy-MM-dd HH:mm:ss.fff";

var dateValue = parseDate(DateString, sdf);

Option 3:

var sdf = "yyyy-MM-dd HH:mm:ss.fffZ";

var dateValue = parseDate(DateString, sdf);

Option 4:

var msec = Date.parse(DateString);

var dateValue = new Date(msec);

1 ACCEPTED SOLUTION

Accepted Solutions
qngo
5-Regular Member
(To:aelgov)

It's almost option 1:

var sdf = "yyyy-MM-dd HH:mm:ss.SSS";

View solution in original post

3 REPLIES 3
qngo
5-Regular Member
(To:aelgov)

It's almost option 1:

var sdf = "yyyy-MM-dd HH:mm:ss.SSS";

aelgov
1-Newbie
(To:qngo)

Thank you very much!!!

Works like a charm...

I just wonder where exactly is it stated to use this format?

Aanjan
9-Granite
(To:aelgov)

Assaf, just to check, what is the 'dateTimeFormat_Default' set to in your Default Localization Table? You can set that value to 'yyyy-MM-dd HH:mm:ss.SSS' for the datetime to be displayed/ rendered with milliseconds.

Top Tags