Java SimpleTimeZone.observesDaylightTime() method example

 Posted On  | Pooja Lakkihal 

In this tutorial, You will learn how to check if this SimpleTimeZone observes Daylight Saving Time or not . Java SimpleTimeZone.observesDaylightTime() method returns true if this SimpleTimeZone observes Daylight Saving Time.

Returns true if this SimpleTimeZone observes Daylight Saving Time. This method is equivalent to useDaylightTime().

syntax

public boolean observesDaylightTime()

Returns

true if this SimpleTimeZone observes Daylight Saving Time; false otherwise.

Java SimpleTimeZone observesDaylightTime() example

  • new SimpleTimeZone(100, "INDIA"); It will construct a SimpleTimeZone with the given base time zone.
  • simpleTimeZone.observesDaylightTime(); It will check if this time zone observes 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 observes day light time ? " + simpleTimeZone.observesDaylightTime());
    }
}

output

Is this observes day light time ? false


© technicalkeeda.com 2018

 |  Find us on Google+ |  Rss Feed

Loaded in 0.0362 seconds.