On my workstation using several browsers, JavaScript's new Date().toString()
method returns a string such as:
Thu Aug 15 2019 17:34:40 GMT-0500 (Central Daylight Time)
I'm interested in how it knows about "Central Daylight Time"?
I know how to get the offset (e.g. -300
) using getTimeZoneOffset(), but I don't see any documented approach to get the named time zone.
Is parsing the output of toString()
really the best approach?