2015-12-17 82 views

回答

2

您可以使用角度的date過濾器。該格式清晰地給出here

{{'2015-12-02T18:30:00.000+0000' | date:"EEE MMM dd yyyy HH:hh:ss 'GMT'Z '(India Standard Time)'"}} 

上面的代碼片斷會給你Thu Dec 03 2015 00:12:00 GMT+0530 (India Standard Time)輸出。也就是那個時候你從+0000計算到+0530

Here是一個有效的解決方案

0

Working fiddle

HTML:

<div ng:app ng:controller="Scoper"> 
    Input: {{v}} <br /> 
    Angular: {{v | date:'EEE MMM dd yyyy HH:mm:ss'}} GMT{{v | date:'+0530' }} (India Standard Time) <br /> 

</div> 

JS

function Scoper($scope) { 
    var s = "2015-12-02T18:30:00.000+0000"; 
    $scope.v = s; 
}