0

I'm using filter to format date string.

$filter('date')(
                "2016-01-19T23:07:37Z",
                'yyyy-MM-dd');

but this always returns 2016-01-20 (I'm in +1 timezone).

I tried to att optional parameter with Timezone. Already tried:

  • "UTC"
  • "UTC/GMT"
  • "GMT"

But always I get 2016-01-20 instead of 2016-01-19

Where I made a mistake?

szpic
  • 4,346
  • 15
  • 54
  • 85
  • What version of Angular are you using? – gfpacheco Jan 20 '16 at 12:51
  • Possible duplicate of [Angular: date filter adds timezone, how to output UTC?](http://stackoverflow.com/questions/21782893/angular-date-filter-adds-timezone-how-to-output-utc) – gfpacheco Jan 20 '16 at 12:52

1 Answers1

0

I found that I was using version 1.2.3 of angular without support for timezones. My fault.

szpic
  • 4,346
  • 15
  • 54
  • 85