How can I make AngularJS simply print the date without applying a time zone ?

angularjs, date, filter

Solution

As it is described in documentation "If no timezone is specified in the string input, the time is considered to be in the local timezone." (http://docs.angularjs.org/api/ng.filter:date). So you can set time zone yourself. For example this will use UTC time zone

`{{'2013-01-01T00:00:00' + 'Z' | date:'yyyy-MM-dd HH:mm'}}`

Result (I'm on the West Coast and have 8 hours difference with London)

`2012-12-31 16:00`

Problem

I return from WEBapi a date like 2013-01-01T00:00:00 And I want ``` {{msa.StartDate | date:'yyyy-MM'}} ``` To be 2013-01 But because it wants to take my current time zone in consideration (US eastern) it is 2012-12 Is there a easy way to tell it DO NOT CARE ABOUT TIMEZONES? Or is there some other filter I can run the date through to ignore my time zone?

Original source