Java TimeZone Clone() Method

The clone() method of TimeZone class is used to create a copy of an object of TimerZone class.

Syntax

Returns

It Returns a clone of an object of TimeZone class

Example 1

Output:

ORIGINAL OBJECT OF TIMERZONE CLASS: sun.util.calendar.ZoneInfo[id="Asia/Calcutta",offset=19800000,dstSavings=0,
useDaylight=false,transitions=7,lastRule=null]
CLONE OBJECT OF TIMERZONE CLASS:sun.util.calendar.ZoneInfo[id="Asia/Calcutta",offset=19800000,dstSavings=0,
useDaylight=false,transitions=7,lastRule=null]

Example 2

Output:

ORIGINAL OBJECT OF TIMERZONE CLASS: java.util.SimpleTimeZone[id=INDIA,offset=500,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]
CLONE OBJECT OF TIMERZONE CLASS:java.util.SimpleTimeZone[id=INDIA,offset=500,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]