bootstrap icon indicating copy to clipboard operation
bootstrap copied to clipboard

TimePicker 2 hours ahead of actual time

Open robson-gilli opened this issue 11 years ago • 2 comments

I'm facing a problem where the model used in the timepicker is always 2 hours ahead of the time that appears on the page.

Changing the original Plunker of the documentation, it's possible for me to see it. Removing the '| date:'shortTime', making the html look like this:

<pre class="alert alert-info">Time is: {{mytime}}</pre>

I have the following display: image

It's possible to see there that the times differs, showing 05:48 on the control but "2015-01-06T19:48:11.064Z" on the line bellow.

I've created this plunker to demonstrate: http://plnkr.co/edit/LLfAOrxYDs2aXaVL8TAu?p=preview

Is there anybody else having the same kind of trouble? Could it be something related to the daylight saving time we have right now? (I'm in Brazil).

Thanks and regards Robson

robson-gilli avatar Jan 06 '15 19:01 robson-gilli

The last part of the string "2015-01-06T19:48:11.064Z" which is "064Z" contains timezone info. It comes from ISO 8601 standard, see: http://en.wikipedia.org/wiki/ISO_8601

If you open a console in your browser and do

var myDate = new Date("2015-01-06T19:48:11.064Z");
myDate

You will have the same value as the one represented by the date picker. If you need more help, please ask your question on SO.

I will close the issue.

antoinepairet avatar Jan 06 '15 20:01 antoinepairet

Thank you and sorry for the silly question.

robson-gilli avatar Jan 07 '15 12:01 robson-gilli