0

I have a record which reads : date: "2016-02-01 00:00:05. However, when I do moment(date).format("L") the view renders 01/31/2016. Any idea why? This happens which all dates, always one day before

  • 1
    Is there an offset in the timestamp? Looks like your issue is timezone based because the output of `format` is technically correct. – bschaeffer Feb 24 '16 at 18:02

1 Answers1

1

I found my answer in this post. Auto-answering in case anybody runs into the same issue. As @bschaeffer said, it was a timezone problem, this fixed it:

moment.utc(date).format('L')
Community
  • 1
  • 1