1

I want the current local(to browser) date with Time zone in the following format:

26-Apr-2016 15:56:18 EDT

I have tried using moment.js but it shows date with timezone like GMT -04:00. Also tried this, but it didn't help.

  var dateDDMMMYYYYFormate = $filter('date')(new Date(input), 'dd-MMM-yyyy  HH:mm:ss');
  var dateWithUtc = moment.utc(dateDDMMMYYYYFormate);
  var localDate = moment(dateWithUtc).local();

Any help is appreciated.

vthallam
  • 551
  • 2
  • 8
  • 20
  • 2
    Possible duplicate of [Using Moment.js to display the users local zone abbreviation](http://stackoverflow.com/questions/24174807/using-moment-js-to-display-the-users-local-zone-abbreviation) – Matt Johnson-Pint Apr 26 '16 at 20:12

1 Answers1

0

Since new Date() creates a JavaScript date object, you want to change the moment object into a date object:

var localDate = moment().toDate();
Community
  • 1
  • 1
fragilewindows
  • 1,394
  • 1
  • 15
  • 26