Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Date.format
Message
 
 
À
Tous
Information générale
Forum:
Javascript
Catégorie:
Autre
Titre:
Date.format
Divers
Thread ID:
01616602
Message ID:
01616602
Vues:
21
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.
If it's not broken, fix it until it is.


My Blog
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform