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

fiddle:http://jsfiddle.net/obv10wd9/2/

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

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -