The string that JavaScript's Date
function returns when you call .toString()
on an instance, or when you implicitly cast to a string such as when writing to the console, is completely implementation dependent. You are not guaranteed to be able to get any time zone abbreviation at all. Some browsers may give an abbreviation, but others may spit out an entire time zone name, such as "Indian Standard Time", and others may just give an offset from UTC or GMT, such as "GMT+05:30". There's nothing in the ECMAScript spec that makes this string anything in particular.
Additionally, recognize that time zone abbreviations can be ambiguous. "IST" might stand for "Indian Standard Time", "Israel Standard Time", or "Ireland Standard Time".
More-so, the abbreviation for Sri Lanka has been "IST" in the time zone database since the switch from +06:00 to +05:30 that occurred in 2006. Before that, the abbreviation "LKT" was used in the database. You can read the entire history here. Wikipedia shows an abbreviation of "SLST", but this isn't implemented in any of the databases that are used for time zones in computing. If you have first-hand knowledge of this abbreviation to be in common use, you could request it to be updated via the tz discussion list at IANA.
In summary - if your system time zone is set for Sri Lanka (Asia/Colombo
on Linux/Mac or Sri Lanka Standard Time|(UTC+05:30) Sri Jayawardenepura
on Windows) and the JavaScript Date
object is showing IST
in your particular browser, then it is doing everything correctly and you should not attempt to change it.