Click here to watch on Youtube:
https://www.youtube.com/watch?v=jPtKu0pyFJA&list=UUhwKlOVR041tngjerWxVccw
TimeZoneDemo.java
Output
Click the below link to download the code:
https://sites.google.com/site/ramj2eev2/java_basics/TimeZoneDemo_getDisplayName_locale.zip?attredirects=0&d=1
Github Link:
https://github.com/ramram43210/Java/tree/master/BasicJava_2018/TimeZoneDemo_getDisplayName_locale
Bitbucket Link:
https://bitbucket.org/ramram43210/java/src/5bada39e8532ab4b75aaa28b80cdcee21bf19ab7/BasicJava_2018/TimeZoneDemo_getDisplayName_locale/?at=master
See also:
All JavaEE Videos Playlist
All JavaEE Videos
All JAVA EE Links
Spring Tutorial
Servlets Tutorial
All Design Patterns Links
JDBC Tutorial
Java Collection Framework Tutorial
JAVA Tutorial
Kids Tutorial
Cooking Tutorial
https://www.youtube.com/watch?v=jPtKu0pyFJA&list=UUhwKlOVR041tngjerWxVccw
TimeZoneDemo.java
import java.util.Locale;
import java.util.TimeZone;
public class TimeZoneDemo
{
public static void main(String[] args)
{
TimeZone timeZone = TimeZone.getDefault();
Locale locale = new Locale("EN", "US");
/*
* Parameters:
*
* locale - the locale in which to supply the display name.
*
* Returns:
*
* the human-readable name of this time zone in the given
* locale.
*/
String displayName = timeZone.getDisplayName(locale);
System.out.println("displayName = " + displayName);
}
}
import java.util.TimeZone;
public class TimeZoneDemo
{
public static void main(String[] args)
{
TimeZone timeZone = TimeZone.getDefault();
Locale locale = new Locale("EN", "US");
/*
* Parameters:
*
* locale - the locale in which to supply the display name.
*
* Returns:
*
* the human-readable name of this time zone in the given
* locale.
*/
String displayName = timeZone.getDisplayName(locale);
System.out.println("displayName = " + displayName);
}
}
Output
displayName = India Standard Time
Click the below link to download the code:
https://sites.google.com/site/ramj2eev2/java_basics/TimeZoneDemo_getDisplayName_locale.zip?attredirects=0&d=1
Github Link:
https://github.com/ramram43210/Java/tree/master/BasicJava_2018/TimeZoneDemo_getDisplayName_locale
Bitbucket Link:
https://bitbucket.org/ramram43210/java/src/5bada39e8532ab4b75aaa28b80cdcee21bf19ab7/BasicJava_2018/TimeZoneDemo_getDisplayName_locale/?at=master
See also:
No comments:
Post a Comment