Thailand uses a different calendar and in Java date.format returns 2056. I have to make sure it matches my JavaScript code. What does this return in Thailand, 2022 or 2056?
(new Date()).getFullYear()
I know there's UTC time but my context is a bit limited.
In Thailand, there are 2 calendars; the normal Gregorian Calendar (solar-based) and the Buddhist Calendar (lunar-based) as called the Thai lunar calendar.
Javascript Date() will return the Gregorian Date. So, today is 11 March 2022.
If you use Intl.DateTimeFormat as specify the Thai buddhist calendar:
console.log(new Intl.DateTimeFormat('en-US-u-ca-buddhist').format(new Date()));
it will return "3/11/2565 BE" which is the 11th day of Month 3 of the year 2565.
Note: This year is year 2565 in the Thai lunar calendar.