Est En Le Fuseau Horaire.setTimeZone(“hne”) différente de Fuseau horaire.setTimeZone(“HNE”)

Quand j'ai écris ce code:

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

La sortie est

   Eastern Standard Time

Mais quand j'ai écris ce code:

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

La sortie que je reçois est:

   GMT-05:00

Est-il une différence en donnant des arguments comme "EST" et "est" lors de la configuration de TimeZone.setTimeZone(String str) (Est str être transmis lors de l'appel considéré comme SENSIBLE à la casse)?

L'API ne mentionne rien à ce sujet:

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: j'ai essayé avec IST et ist cordes. Pour IST chaîne, il donne Indian Standard Time et pour ist il donne Greenwich Mean Time

  • en bas de l'électeur, veuillez laisser un commentaire.
InformationsquelleAutor Abubakkar | 2012-11-05