I have a date in UTC format that I need to convert to CST.
It is 5 hours ahead of UTC during CDT and 6 hours ahead during CTC.
The UTC date is '2016-09-07T05:00:00Z'
<body>
<div ng-app="myApp" ng-controller="datCtrl">
<p>Date = {{ today | date:'longDate':'CST' }}</p>
</div>
<script>
var app = angular.module('myApp', []);
app.controller('datCtrl', function($scope) {
$scope.today = '2016-09-07T05:00:00Z'
});
</script>
This converts my date to
Date = September 6, 2016
However, this is during daylight saving time. If I switch from CST to CDT, it works correctly for this case but not for other months without daylight saving time.
Is there any solution that can automatically determine which timezone (CTC/CDT) needs to be applied?