Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Date.format
Message
 
 
À
10/03/2015 15:06:17
Information générale
Forum:
Javascript
Catégorie:
Autre
Titre:
Divers
Thread ID:
01616602
Message ID:
01616606
Vues:
24
>>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.

So, what should I use to properly format my date? Should I use upper case SSS instead?

SSS seems to be working. Wow, I spent about 5+ hours fixing the directive again...
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform