Click here to watch on Youtube :
https://www.youtube.com/watch?v=2_79CwfFU3E&list=UUhwKlOVR041tngjerWxVccw
Click the below Image to Enlarge
Java 8 ZoneOffset Class Introduction | Java 8 Date and Time | Java Date and Time |
import java.time.ZoneOffset;
public class ZoneOffsetDemo
{
public static void main(String[] args)
{
/*
* Constant for the minimum supported offset.
*/
ZoneOffset zoneOffsetMin = ZoneOffset.MIN;
System.out.println("zoneOffsetMin = " + zoneOffsetMin);
/*
* Constant for the maximum supported offset.
*/
ZoneOffset zoneOffsetMax = ZoneOffset.MAX;
System.out.println("zoneOffsetMax = " + zoneOffsetMax);
/*
* The time-zone offset for UTC, with an ID of 'Z'.
*/
ZoneOffset zoneOffsetUtc = ZoneOffset.UTC;
System.out.println("zoneOffsetUtc = " + zoneOffsetUtc);
}
}
public class ZoneOffsetDemo
{
public static void main(String[] args)
{
/*
* Constant for the minimum supported offset.
*/
ZoneOffset zoneOffsetMin = ZoneOffset.MIN;
System.out.println("zoneOffsetMin = " + zoneOffsetMin);
/*
* Constant for the maximum supported offset.
*/
ZoneOffset zoneOffsetMax = ZoneOffset.MAX;
System.out.println("zoneOffsetMax = " + zoneOffsetMax);
/*
* The time-zone offset for UTC, with an ID of 'Z'.
*/
ZoneOffset zoneOffsetUtc = ZoneOffset.UTC;
System.out.println("zoneOffsetUtc = " + zoneOffsetUtc);
}
}
Output
zoneOffsetMin = -18:00
zoneOffsetMax = +18:00
zoneOffsetUtc = Z
zoneOffsetMax = +18:00
zoneOffsetUtc = Z
Refer:
Click the below link to download the code:
https://sites.google.com/site/ramj2eev1/home/javabasics/ZoneOffsetDemo_intro.zip?attredirects=0&d=1
Github Link:
https://github.com/ramram43210/Java/tree/master/BasicJava/ZoneOffsetDemo_intro
Bitbucket Link:
https://bitbucket.org/ramram43210/java/src/8e3f14caa10b52912934997a22df069c728f47b4/BasicJava/ZoneOffsetDemo_intro/?at=master
See also:
No comments:
Post a Comment