Java SimpleTimeZone.toString() method example

 Posted On  | Pooja Lakkihal 

In this tutorial, You will learn how to get a string representation of this time zone. Java SimpleTimeZone.toString() method returns a string of this instance.

Returns a string representation of this time zone.

syntax

public String toString()

Returns

A string representation of this time zone.

Java SimpleTimeZone toString() example

  • new SimpleTimeZone(100, "INDIA"); It will construct a SimpleTimeZone with the given base time zone.
  • simpleTimeZone.toString(); It will return a string representation of this time zone.
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("String value is :- " + simpleTimeZone.toString());

    }
}

output

String value is :- java.util.SimpleTimeZone[id=INDIA,offset=100,dstSavings=3600000,useDaylight=false,startYear=0,startMode=0,startMonth=0,startDay=0,startDayOfWeek=0,startTime=0,startTimeMode=0,endMode=0,endMonth=0,endDay=0,endDayOfWeek=0,endTime=0,endTimeMode=0]


© technicalkeeda.com 2018

 |  Find us on Google+ |  Rss Feed

Loaded in 0.0638 seconds.