Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Date.format
Message
From
10/03/2015 15:06:17
 
General information
Forum:
Javascript
Category:
Other
Title:
Miscellaneous
Thread ID:
01616602
Message ID:
01616605
Views:
34
This message has been marked as the solution to the initial question of the thread.
>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform