I am too facing same problem as mentioned by Sandip Bhavsar... :( 

On Monday, 28 January 2013 15:55:16 UTC+5:30, Sandip Bhavsar wrote:
>
> Hello All,
>
> I have issue with displaying time using datefilter.
>
> Below is scenario :
>
> When I pass "2013-01-28T*15:20:02*.577" to datefilter : "{{date2 | 
> date:'yyyy-MM-dd HH:mm:ss Z'}}". It converts to "2013-01-28 *20:50:02* 
> -5.530"
>
> I had pass "15:20:02" time and it converts to "20:50:02" . I need same 
> time as I have passed.
>
> Please help.
>
> On Monday, January 7, 2013 4:06:10 AM UTC+5:30, Joshua Miller wrote:
>>
>> Hello! Thanks for responding.
>>
>> @Ivo - you are right about the second one. That was my mistake.
>>
>> @Pawel - The localization performed by the filter is a big value. But my 
>> expectation for it is that it would be uniform in its handling of dates. If 
>> Javascript localizes the date when creating a Date object (which it 
>> arguably should), then my assumption was that the filter would do the same.
>>
>> But after further thought, I realize this is tricky territory; if a date 
>> is coming from the server (as most probably are) then the app cannot assume 
>> that a local timezone applies. That said, if a server is storing dates, 
>> then it really _should_ be stored with a timezone anyway.
>>
>> I can see both sides of this, but my personal preference would be to 
>> assume local time (rather than UTC) when none is specified. This would make 
>> the filter consistent in its output when handling strings and Date objects 
>> - and make the most sense for the "best practice" cases for client- and 
>> server-generated date strings.
>>
>> Thoughts?
>>
>> Josh
>>
>>
>> On Sun, Jan 6, 2013 at 1:52 PM, Ivo Reis <reis...@gmail.com> wrote:
>>
>>> Hey Joshua, 
>>>
>>> Here the example works fine, maybe because my time is UTC. The 
>>> only difference i found was on the second example  new Date(2013, 01, 01); 
>>> but maybe it's because the month, in this format, should start at 0 
>>> (January)
>>>
>>>
>>> Domingo, 6 de Janeiro de 2013 21:24:34 UTC, Joshua Miller escreveu:
>>>
>>>> Hello!
>>>>
>>>> When using the date filter, the date string and object I provide seem 
>>>> to be treated by default as UTC, so when I use the filter, it localizes 
>>>> the 
>>>> date, which becomes eight hours off (PST). If I provide an 'T' offset to 
>>>> the filter, all works fine. 
>>>>
>>>> Here's a Plunker: http://plnkr.co/edit/Jhwnkj?p=preview.
>>>>
>>>> What am I doing incorrectly?
>>>>
>>>> Josh
>>>>
>>>  -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "AngularJS" group.
>>> To post to this group, send email to ang...@googlegroups.com.
>>> To unsubscribe from this group, send email to 
>>> angular+u...@googlegroups.com.
>>> Visit this group at http://groups.google.com/group/angular?hl=en-US.
>>>  
>>>  
>>>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to