0

I have npm moment in my application using that need to convert selected time into the specified GMT timezone getting from server

my time zone is +5.30, I need to convert my local time into GMT and pass to the server

I tried the following code but its not converting to the GMT/ UTC time

moment(new Date()).subtract(5.30, 'hour')).toDate() // getting wrong answer

hoangdv
  • 15,138
  • 4
  • 27
  • 48
Rijo
  • 2,963
  • 5
  • 35
  • 62
  • Does this answer your question? [Format date in a specific timezone](https://stackoverflow.com/questions/15347589/format-date-in-a-specific-timezone) – Andrew Evt Mar 19 '21 at 06:12
  • Does this answer your question? [Convert date to UTC using moment.js](https://stackoverflow.com/questions/23299950/convert-date-to-utc-using-moment-js) – diiN__________ Mar 19 '21 at 06:13

0 Answers0