I have a filter that i use to convert date to UTC date.
.filter('utc', function(){
return function(val){
var date = new Date(val);
return new Date(date.getUTCFullYear(),
date.getUTCMonth(),
date.getUTCDate(),
date.getUTCHours(),
date.getUTCMinutes(),
date.getUTCSeconds(),date.getTimezoneOffset());
};
})
So when i give the date 2016-06-18
It returns the date like this Sat Jun 18 2016 00:00:00 GMT-0400 (Eastern Daylight Time)
The date is correct but its not reflecting the correct timezone.
I want it to return in UTC timezone, like Z at the end