Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8781029
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T20:11:48+00:00 2026-06-13T20:11:48+00:00

When I write this code: Calendar cal = Calendar.getInstance(); cal.setTimeZone(TimeZone.getTimeZone(EST)); System.out.println(cal.getTimeZone().getDisplayName()); The output is

  • 0

When I write this code:

   Calendar cal = Calendar.getInstance();
   cal.setTimeZone(TimeZone.getTimeZone("EST"));
   System.out.println(cal.getTimeZone().getDisplayName());

The output is

   Eastern Standard Time

But when I write this code:

   Calendar cal = Calendar.getInstance();
   cal.setTimeZone(TimeZone.getTimeZone("est"));
   System.out.println(cal.getTimeZone().getDisplayName());

The output I get is:

   GMT-05:00

Is there any difference in giving arguments like “EST” and “est” when setting TimeZone.setTimeZone(String str) (Is str to be passed when calling considered CASE SENSITIVE)?

The API doesn’t mention anything about it:

getTimeZone

public static TimeZone getTimeZone(String ID)

Gets the TimeZone for the given ID.

Parameters:  
ID - the ID for a TimeZone, either an abbreviation such as "PST", a full name such as "America/Los_Angeles", or a custom ID such as "GMT-8:00".   
Note that the support of abbreviations is for JDK 1.1.x compatibility only and full names should be used.

Returns:
the specified TimeZone, or the GMT zone if the given ID cannot be understood.

NOTE: I tried with IST and ist strings. For IST string it gives Indian Standard Time and for ist it gives Greenwich Mean Time

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T20:11:49+00:00Added an answer on June 13, 2026 at 8:11 pm

    In short, yes it is case sensitive.

    Following your examples ist gives you GMT because a timezone with such an ID can’t be find, thus giving you default result

    it works with est (GMT-05:00 is EASTERN STANDARD TIME), surely because both IDs are known, but I wouldn’t count on it (not too sure it would still be there if change platform).

    Furthermore, as told by the API you shouldn’t use those abbreviated IDs but directly full name or custom ID.

    You can have a list of your platform’s available IDs using TimeZone.getAvailableIDs(), then you can pick the right one.

    I would myself consider using GMT-5:00 format, which is in my opinion more readable and less error prone.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I write this code to get Dunnet anova post hoc test import rpy2.robjects as
i write this code in main.java ArrayList<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(); try{ HttpClient httpclient
I have write this code but it does work only if I am already
I've write this code to add textview into table row, but I've problem for
would someone please write this code: this.Loaded += (s, e) => this.loaded = true;
How can I write this code more cleanly/concisely? /// <summary> /// Creates a set
how can i write this code from aspx page in code behind? <a href=skype:MySkype?call><img
I'm trying to write this code using mostly arrays. I'm trying to get Correct
I got error when I write this code @Html.X().ResourceManager() in view error message :
There's another way to write this code ? I think it's kinda unprofessional and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.