0

I'm trying to convert input date to japan timezone with this code

var japanTime = new Date(input).toLocaleString("en-US", { timeZone: "Japan" });
        japanTime = new Date(japanTime);
        message.channel.send('JAP time output: ' + japanTime.toLocaleString());

It runs normally on Visual Studio Code but when I deploy it on heroku and try to convert any date, I got this error RangeError: Expected Area/Location(/Location)* for time zone, got Japan

Doan Van Thang
  • 989
  • 1
  • 10
  • 21

1 Answers1

1

The IANA time zone identifier for Japan is Asia/Tokyo, not Japan

Chris Satchell
  • 751
  • 5
  • 17