Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X
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);
Solved! Go to Solution.
It's almost option 1:
var sdf = "yyyy-MM-dd HH:mm:ss.SSS";
Thank you very much!!!
Works like a charm...
I just wonder where exactly is it stated to use this format?
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.