Friday, 9 March 2018

Java 8 ZoneOffset Class Introduction | Java 8 Date and Time | Java Date and Time


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 
ZoneOffsetDemo.java
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);
    }

}

Output

zoneOffsetMin = -18:00
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:

  • All JavaEE Videos Playlist
  • All JavaEE Videos
  • All JAVA EE Links
  • Servlets Tutorial
  • All Design Patterns Links
  • JDBC Tutorial
  • Java Collection Framework Tutorial
  • JAVA Tutorial
  • Kids Tutorial
  • No comments:

    Post a Comment