Cid
Cid

Reputation: 1453

Why is the TimeZone.getTimeZone("MST") method is different from getTimeZone("US/Mountain")?

TimeZone.getTimeZone("US/Mountain") and TimeZone.getTimeZone("MST") are returning different results. Does MST in this java class not represent "Mountain Standard Time"?

Upvotes: 4

Views: 2920

Answers (1)

Mat
Mat

Reputation: 206689

You should not use the short three letter names (MST) in Java. This has been deprecated since 1998 (see JDK 1.3 TimeZone).

See Sun Alert 102836 for more info on some issues and workarounds, but you should really be using long names ("America/Denver" I believe in this case).

Upvotes: 6

Related Questions