Trent Trent - 3 months ago 22
AngularJS Question

Angular js : convert date to another timezone

I have to convert my date to different timezone based on the logged user timezone

I have tried

$scope.currentDate =;
$ = 'America/New_York';

In view i have called like this
{{currentDate | date:'h:mm a' : t}}

But it's not working., could i achieve this?


Make use of Moment timezone JS

var app = angular.module('app', []);

app.controller('mainCtrl', function($scope) {
  var now = moment(new Date());
  $scope.currentDate ='America/New_York').format('hh:mm a');
<script src=""></script>
<script src=""></script>

<script src=""></script>
<div ng-app='app'>
  <div ng-controller='mainCtrl'>
    <h4>{{ currentDate }}