Java SimpleTimeZone.useDaylightTime() method example

 Posted On  | Pooja Lakkihal 

In this tutorial, You will learn how to check if this time zone uses daylight saving time or not. Java SimpleTimeZone.useDaylightTime() method returns true if this time zone uses daylight saving time.

Queries if this time zone uses daylight saving time.

syntax

public boolean useDaylightTime()

Returns

true if this time zone uses daylight saving time; false otherwise.

Java SimpleTimeZone useDaylightTime() example

  • new SimpleTimeZone(100, "INDIA"); It will construct a SimpleTimeZone with the given base time zone.
  • simpleTimeZone.useDaylightTime(); It will check if this time zone uses daylight saving time.
package com.technicalkeeda;

import java.util.SimpleTimeZone;

public class App {

    public static void main(String[] args) {

        SimpleTimeZone simpleTimeZone = new SimpleTimeZone(100, "INDIA");

        System.out.println("Is this Uses day light time ? " + simpleTimeZone.useDaylightTime());
    }
}

output

Is this Uses day light time ? false


© technicalkeeda.com 2018

 |  Find us on Google+ |  Rss Feed

Loaded in 0.0387 seconds.