javascript - Showing wrong date conversion in angular v1.1 -
i having time="2015-06-26t18:50:07.000z" using angularv1.1 ,i can not use utc , dont have milliseconds well, have time string
in html
<div ng-app='myapp' ng-controller="myctrl"> {{date | date:"mm/dd/yyyy" }} </div>
in controller
var x="2015-06-26t18:50:07.000z" var app=angular.module('myapp',[]); app.controller('myctrl',function($scope){ $scope.date=x; });
where want output 06/26/2015 , showing 06/27/2015 may problem of gmt or utc whatever .
please suggest me ,what can show 06/26/2015
please check one.
you can this.
var x="2015-06-26t18:50:07.000z" var app=angular.module('myapp',[]); app.controller('myctrl',function($scope){ var date=new date(x); $scope.date = new date(date.gettime() +(date.gettimezoneoffset()*60000)); console.log(typeof $scope.date) });
here updated fiddle
Comments
Post a Comment