1

How to set default timezone in date object.

const date=new Date(val).getTime().toLocaleString("en-US", { timeZone: "Asia/Dubai" }),
Nick
  • 11
  • 1
  • `Date` object always sets the local timezone (computer timezone) I suppose. why do you need to do that? [This](https://stackoverflow.com/questions/15141762/how-to-initialize-a-javascript-date-to-a-particular-time-zone) should answer your question. – ANewGuyInTown May 20 '22 at 09:24
  • I need to set particular timezone and also convert that time into milliseconds – Nick May 20 '22 at 09:29
  • [This](https://stackoverflow.com/questions/10087819/convert-date-to-another-timezone-in-javascript) should help. – ANewGuyInTown May 20 '22 at 09:33

0 Answers0