>Hi everybody,
>
>According to this page
https://docs.angularjs.org/api/ng/filter/date the milliseconds are supposed to be .sss in the format string.
>
>I'm trying the following code:
>
>
>var format = function (date) {
> if (date) {
> if (!pickTime) {
> if (isEndDate && !onlyFutureDates) {
> date = date.hours(23).minutes(59).seconds(59).milliseconds(997);
> date = date.format("YYYY-MM-DDTHH:mm:ss.sss").toString();
> } else {
> date = date.hours(0).minutes(0).seconds(0).milliseconds(0);
> date = date.format("YYYY-MM-DDTHH:mm:ss").toString();
> }
> }
> }
> return date;
> };
>
>and I've been tracing it in Visual Studio immediate window and I can see that it returns seconds after seconds instead of milliseconds. In other words, my date ends by 997 but I am seeing 595 instead.
>
>I am wondering what should I use here instead in order to see correctly formatted date with milliseconds?
>
>Thanks a lot in advance.
I don't think you can use the 's' variants twice. Either 'ss' for seconds or 'sss' for milliseconds.