Java Doc for SimpleTimeZone.java in  » 6.0-JDK-Core » Collections-Jar-Zip-Logging-regex » java » util » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Home
Java Source Code / Java Documentation
1.6.0 JDK Core
2.6.0 JDK Modules
3.6.0 JDK Modules com.sun
4.6.0 JDK Modules com.sun.java
5.6.0 JDK Modules sun
6.6.0 JDK Platform
7.Ajax
8.Apache Harmony Java SE
9.Aspect oriented
10.Authentication Authorization
11.Blogger System
12.Build
13.Byte Code
14.Cache
15.Chart
16.Chat
17.Code Analyzer
18.Collaboration
19.Content Management System
20.Database Client
21.Database DBMS
22.Database JDBC Connection Pool
23.Database ORM
24.Development
25.EJB Server
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Net
51.Parser
52.PDF
53.Portal
54.Profiler
55.Project Management
56.Report
57.RSS RDF
58.Rule Engine
59.Science
60.Scripting
61.Search Engine
62.Security
63.Sevlet Container
64.Source Control
65.Swing Library
66.Template Engine
67.Test Coverage
68.Testing
69.UML
70.Web Crawler
71.Web Framework
72.Web Mail
73.Web Server
74.Web Services
75.Web Services apache cxf 2.2.6
76.Web Services AXIS2
77.Wiki Engine
78.Workflow Engines
79.XML
80.XML UI
Java Source Code / Java Documentation » 6.0 JDK Core » Collections Jar Zip Logging regex » java.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.util.TimeZone
      java.util.SimpleTimeZone

SimpleTimeZone
public class SimpleTimeZone extends TimeZone (Code)
SimpleTimeZone is a concrete subclass of TimeZone that represents a time zone for use with a Gregorian calendar. The class holds an offset from GMT, called raw offset, and start and end rules for a daylight saving time schedule. Since it only holds single values for each, it cannot handle historical changes in the offset from GMT and the daylight saving schedule, except that the SimpleTimeZone.setStartYear setStartYear method can specify the year when the daylight saving time schedule starts in effect.

To construct a SimpleTimeZone with a daylight saving time schedule, the schedule can be described with a set of rules, start-rule and end-rule. A day when daylight saving time starts or ends is specified by a combination of month, day-of-month, and day-of-week values. The month value is represented by a Calendar Calendar.MONTH MONTH field value, such as Calendar.MARCH . The day-of-week value is represented by a Calendar Calendar.DAY_OF_WEEK DAY_OF_WEEK value, such as Calendar.SUNDAY SUNDAY . The meanings of value combinations are as follows.

  • Exact day of month
    To specify an exact day of month, set the month and day-of-month to an exact value, and day-of-week to zero. For example, to specify March 1, set the month to Calendar.MARCHMARCH , day-of-month to 1, and day-of-week to 0.
  • Day of week on or after day of month
    To specify a day of week on or after an exact day of month, set the month to an exact month value, day-of-month to the day on or after which the rule is applied, and day-of-week to a negative Calendar.DAY_OF_WEEK DAY_OF_WEEK field value. For example, to specify the second Sunday of April, set month to Calendar.APRIL APRIL , day-of-month to 8, and day-of-week to - Calendar.SUNDAY SUNDAY .
  • Day of week on or before day of month
    To specify a day of the week on or before an exact day of the month, set day-of-month and day-of-week to a negative value. For example, to specify the last Wednesday on or before the 21st of March, set month to Calendar.MARCH MARCH , day-of-month is -21 and day-of-week is - Calendar.WEDNESDAY WEDNESDAY .
  • Last day-of-week of month
    To specify, the last day-of-week of the month, set day-of-week to a Calendar.DAY_OF_WEEK DAY_OF_WEEK value and day-of-month to -1. For example, to specify the last Sunday of October, set month to Calendar.OCTOBER OCTOBER , day-of-week to Calendar.SUNDAY SUNDAY and day-of-month to -1.
The time of the day at which daylight saving time starts or ends is specified by a millisecond value within the day. There are three kinds of modes to specify the time: SimpleTimeZone.WALL_TIME , SimpleTimeZone.STANDARD_TIME and SimpleTimeZone.UTC_TIME . For example, if daylight saving time ends at 2:00 am in the wall clock time, it can be specified by 7200000 milliseconds in the SimpleTimeZone.WALL_TIME mode. In this case, the wall clock time for an end-rule means the same thing as the daylight time.

The following are examples of parameters for constructing time zone objects.


 // Base GMT offset: -8:00
 // DST starts:      at 2:00am in standard time
 //                  on the first Sunday in April
 // DST ends:        at 2:00am in daylight time
 //                  on the last Sunday in October
 // Save:            1 hour
 SimpleTimeZone(-28800000,
 "America/Los_Angeles",
 Calendar.APRIL, 1, -Calendar.SUNDAY,
 7200000,
 Calendar.OCTOBER, -1, Calendar.SUNDAY,
 7200000,
 3600000)
 // Base GMT offset: +1:00
 // DST starts:      at 1:00am in UTC time
 //                  on the last Sunday in March
 // DST ends:        at 1:00am in UTC time
 //                  on the last Sunday in October
 // Save:            1 hour
 SimpleTimeZone(3600000,
 "Europe/Paris",
 Calendar.MARCH, -1, Calendar.SUNDAY,
 3600000, SimpleTimeZone.UTC_TIME,
 Calendar.OCTOBER, -1, Calendar.SUNDAY,
 3600000, SimpleTimeZone.UTC_TIME,
 3600000)
 
These parameter rules are also applicable to the set rule methods, such as setStartRule.
since:
   1.1
See Also:   Calendar
See Also:   GregorianCalendar
See Also:   TimeZone
version:
   1.58 05/05/07
author:
   David Goldsmith, Mark Davis, Chen-Lieh Huang, Alan Liu


Field Summary
final public static  intSTANDARD_TIME
     Constant for a mode of start or end time specified as standard time.
final public static  intUTC_TIME
     Constant for a mode of start or end time specified as UTC.
final public static  intWALL_TIME
     Constant for a mode of start or end time specified as wall clock time.
final static  intcurrentSerialVersion
    
final static  longserialVersionUID
    

Constructor Summary
public  SimpleTimeZone(int rawOffset, String ID)
     Constructs a SimpleTimeZone with the given base time zone offset from GMT and time zone ID with no daylight saving time schedule.
public  SimpleTimeZone(int rawOffset, String ID, int startMonth, int startDay, int startDayOfWeek, int startTime, int endMonth, int endDay, int endDayOfWeek, int endTime)
     Constructs a SimpleTimeZone with the given base time zone offset from GMT, time zone ID, and rules for starting and ending the daylight time. Both startTime and endTime are specified to be represented in the wall clock time.
public  SimpleTimeZone(int rawOffset, String ID, int startMonth, int startDay, int startDayOfWeek, int startTime, int endMonth, int endDay, int endDayOfWeek, int endTime, int dstSavings)
     Constructs a SimpleTimeZone with the given base time zone offset from GMT, time zone ID, and rules for starting and ending the daylight time. Both startTime and endTime are assumed to be represented in the wall clock time.
public  SimpleTimeZone(int rawOffset, String ID, int startMonth, int startDay, int startDayOfWeek, int startTime, int startTimeMode, int endMonth, int endDay, int endDayOfWeek, int endTime, int endTimeMode, int dstSavings)
     Constructs a SimpleTimeZone with the given base time zone offset from GMT, time zone ID, and rules for starting and ending the daylight time. This constructor takes the full set of the start and end rules parameters, including modes of startTime and endTime.

Method Summary
public  Objectclone()
     Returns a clone of this SimpleTimeZone instance.
public  booleanequals(Object obj)
     Compares the equality of two SimpleTimeZone objects.
Parameters:
  obj - The SimpleTimeZone object to be compared with.
public  intgetDSTSavings()
     Returns the amount of time in milliseconds that the clock is advanced during daylight saving time.
public  intgetOffset(long date)
     Returns the offset of this time zone from UTC at the given time.
public  intgetOffset(int era, int year, int month, int day, int dayOfWeek, int millis)
     Returns the difference in milliseconds between local time and UTC, taking into account both the raw offset and the effect of daylight saving, for the specified date and time.
 intgetOffsets(long date, int[] offsets)
    
public  intgetRawOffset()
     Gets the GMT offset for this time zone.
public  booleanhasSameRules(TimeZone other)
     Returns true if this zone has the same rules and offset as another zone.
public synchronized  inthashCode()
     Generates the hash code for the SimpleDateFormat object.
public  booleaninDaylightTime(Date date)
     Queries if the given date is in daylight saving time.
public  voidsetDSTSavings(int millisSavedDuringDST)
     Sets the amount of time in milliseconds that the clock is advanced during daylight saving time.
Parameters:
  millisSavedDuringDST - the number of milliseconds the time isadvanced with respect to standard time when the daylight saving time rulesare in effect.
public  voidsetEndRule(int endMonth, int endDay, int endDayOfWeek, int endTime)
     Sets the daylight saving time end rule.
public  voidsetEndRule(int endMonth, int endDay, int endTime)
     Sets the daylight saving time end rule to a fixed date within a month. This method is equivalent to:
setEndRule(endMonth, endDay, 0, endTime)

Parameters:
  endMonth - The daylight saving time ending month.
public  voidsetEndRule(int endMonth, int endDay, int endDayOfWeek, int endTime, boolean after)
     Sets the daylight saving time end rule to a weekday before or after the given date within a month, e.g., the first Monday on or after the 8th.
Parameters:
  endMonth - The daylight saving time ending month.
public  voidsetRawOffset(int offsetMillis)
     Sets the base time zone offset to GMT.
public  voidsetStartRule(int startMonth, int startDay, int startDayOfWeek, int startTime)
     Sets the daylight saving time start rule.
public  voidsetStartRule(int startMonth, int startDay, int startTime)
     Sets the daylight saving time start rule to a fixed date within a month. This method is equivalent to:
setStartRule(startMonth, startDay, 0, startTime)

Parameters:
  startMonth - The daylight saving time starting month.
public  voidsetStartRule(int startMonth, int startDay, int startDayOfWeek, int startTime, boolean after)
     Sets the daylight saving time start rule to a weekday before or after the given date within a month, e.g., the first Monday on or after the 8th.
Parameters:
  startMonth - The daylight saving time starting month.
public  voidsetStartYear(int year)
     Sets the daylight saving time starting year.
public  StringtoString()
     Returns a string representation of this time zone.
public  booleanuseDaylightTime()
     Queries if this time zone uses daylight saving time.

Field Detail
STANDARD_TIME
final public static int STANDARD_TIME(Code)
Constant for a mode of start or end time specified as standard time.
since:
   1.4



UTC_TIME
final public static int UTC_TIME(Code)
Constant for a mode of start or end time specified as UTC. European Union rules are specified as UTC time, for example.
since:
   1.4



WALL_TIME
final public static int WALL_TIME(Code)
Constant for a mode of start or end time specified as wall clock time. Wall clock time is standard time for the onset rule, and daylight time for the end rule.
since:
   1.4



currentSerialVersion
final static int currentSerialVersion(Code)



serialVersionUID
final static long serialVersionUID(Code)




Constructor Detail
SimpleTimeZone
public SimpleTimeZone(int rawOffset, String ID)(Code)
Constructs a SimpleTimeZone with the given base time zone offset from GMT and time zone ID with no daylight saving time schedule.
Parameters:
  rawOffset - The base time zone offset in milliseconds to GMT.
Parameters:
  ID - The time zone name that is given to this instance.



SimpleTimeZone
public SimpleTimeZone(int rawOffset, String ID, int startMonth, int startDay, int startDayOfWeek, int startTime, int endMonth, int endDay, int endDayOfWeek, int endTime)(Code)
Constructs a SimpleTimeZone with the given base time zone offset from GMT, time zone ID, and rules for starting and ending the daylight time. Both startTime and endTime are specified to be represented in the wall clock time. The amount of daylight saving is assumed to be 3600000 milliseconds (i.e., one hour). This constructor is equivalent to:

 SimpleTimeZone(rawOffset,
 ID,
 startMonth,
 startDay,
 startDayOfWeek,
 startTime,
 SimpleTimeZone.
SimpleTimeZone.WALL_TIME ,
 endMonth,
 endDay,
 endDayOfWeek,
 endTime,
 SimpleTimeZone.
SimpleTimeZone.WALL_TIME ,
 3600000)
 

Parameters:
  rawOffset - The given base time zone offset from GMT.
Parameters:
  ID - The time zone ID which is given to this object.
Parameters:
  startMonth - The daylight saving time starting month. Month isa Calendar.MONTH MONTH field value (0-based. e.g., 0for January).
Parameters:
  startDay - The day of the month on which the daylight saving time starts.See the class description for the special cases of this parameter.
Parameters:
  startDayOfWeek - The daylight saving time starting day-of-week.See the class description for the special cases of this parameter.
Parameters:
  startTime - The daylight saving time starting time in local wall clocktime (in milliseconds within the day), which is localstandard time in this case.
Parameters:
  endMonth - The daylight saving time ending month. Month isa Calendar.MONTH MONTH fieldvalue (0-based. e.g., 9 for October).
Parameters:
  endDay - The day of the month on which the daylight saving time ends.See the class description for the special cases of this parameter.
Parameters:
  endDayOfWeek - The daylight saving time ending day-of-week.See the class description for the special cases of this parameter.
Parameters:
  endTime - The daylight saving ending time in local wall clock time,(in milliseconds within the day) which is local daylighttime in this case.
exception:
  IllegalArgumentException - if the month, day, dayOfWeek, or timeparameters are out of range for the start or end rule



SimpleTimeZone
public SimpleTimeZone(int rawOffset, String ID, int startMonth, int startDay, int startDayOfWeek, int startTime, int endMonth, int endDay, int endDayOfWeek, int endTime, int dstSavings)(Code)
Constructs a SimpleTimeZone with the given base time zone offset from GMT, time zone ID, and rules for starting and ending the daylight time. Both startTime and endTime are assumed to be represented in the wall clock time. This constructor is equivalent to:

 SimpleTimeZone(rawOffset,
 ID,
 startMonth,
 startDay,
 startDayOfWeek,
 startTime,
 SimpleTimeZone.
SimpleTimeZone.WALL_TIME ,
 endMonth,
 endDay,
 endDayOfWeek,
 endTime,
 SimpleTimeZone.
SimpleTimeZone.WALL_TIME ,
 dstSavings)
 

Parameters:
  rawOffset - The given base time zone offset from GMT.
Parameters:
  ID - The time zone ID which is given to this object.
Parameters:
  startMonth - The daylight saving time starting month. Month isa Calendar.MONTH MONTH fieldvalue (0-based. e.g., 0 for January).
Parameters:
  startDay - The day of the month on which the daylight saving time starts.See the class description for the special cases of this parameter.
Parameters:
  startDayOfWeek - The daylight saving time starting day-of-week.See the class description for the special cases of this parameter.
Parameters:
  startTime - The daylight saving time starting time in local wall clocktime, which is local standard time in this case.
Parameters:
  endMonth - The daylight saving time ending month. Month isa Calendar.MONTH MONTH fieldvalue (0-based. e.g., 9 for October).
Parameters:
  endDay - The day of the month on which the daylight saving time ends.See the class description for the special cases of this parameter.
Parameters:
  endDayOfWeek - The daylight saving time ending day-of-week.See the class description for the special cases of this parameter.
Parameters:
  endTime - The daylight saving ending time in local wall clock time,which is local daylight time in this case.
Parameters:
  dstSavings - The amount of time in milliseconds saved duringdaylight saving time.
exception:
  IllegalArgumentException - if the month, day, dayOfWeek, or timeparameters are out of range for the start or end rule
since:
   1.2



SimpleTimeZone
public SimpleTimeZone(int rawOffset, String ID, int startMonth, int startDay, int startDayOfWeek, int startTime, int startTimeMode, int endMonth, int endDay, int endDayOfWeek, int endTime, int endTimeMode, int dstSavings)(Code)
Constructs a SimpleTimeZone with the given base time zone offset from GMT, time zone ID, and rules for starting and ending the daylight time. This constructor takes the full set of the start and end rules parameters, including modes of startTime and endTime. The mode specifies either SimpleTimeZone.WALL_TIME walltime or SimpleTimeZone.STANDARD_TIME standard time or SimpleTimeZone.UTC_TIME UTCtime .
Parameters:
  rawOffset - The given base time zone offset from GMT.
Parameters:
  ID - The time zone ID which is given to this object.
Parameters:
  startMonth - The daylight saving time starting month. Month isa Calendar.MONTH MONTH fieldvalue (0-based. e.g., 0 for January).
Parameters:
  startDay - The day of the month on which the daylight saving time starts.See the class description for the special cases of this parameter.
Parameters:
  startDayOfWeek - The daylight saving time starting day-of-week.See the class description for the special cases of this parameter.
Parameters:
  startTime - The daylight saving time starting time in the time modespecified by startTimeMode.
Parameters:
  startTimeMode - The mode of the start time specified by startTime.
Parameters:
  endMonth - The daylight saving time ending month. Month isa Calendar.MONTH MONTH fieldvalue (0-based. e.g., 9 for October).
Parameters:
  endDay - The day of the month on which the daylight saving time ends.See the class description for the special cases of this parameter.
Parameters:
  endDayOfWeek - The daylight saving time ending day-of-week.See the class description for the special cases of this parameter.
Parameters:
  endTime - The daylight saving ending time in time time modespecified by endTimeMode.
Parameters:
  endTimeMode - The mode of the end time specified by endTime
Parameters:
  dstSavings - The amount of time in milliseconds saved duringdaylight saving time.
exception:
  IllegalArgumentException - if the month, day, dayOfWeek, time more, ortime parameters are out of range for the start or end rule, or if a time modevalue is invalid.
See Also:   SimpleTimeZone.WALL_TIME
See Also:   SimpleTimeZone.STANDARD_TIME
See Also:   SimpleTimeZone.UTC_TIME
since:
   1.4




Method Detail
clone
public Object clone()(Code)
Returns a clone of this SimpleTimeZone instance. a clone of this instance.



equals
public boolean equals(Object obj)(Code)
Compares the equality of two SimpleTimeZone objects.
Parameters:
  obj - The SimpleTimeZone object to be compared with. True if the given obj is the same as thisSimpleTimeZone object; false otherwise.



getDSTSavings
public int getDSTSavings()(Code)
Returns the amount of time in milliseconds that the clock is advanced during daylight saving time. the number of milliseconds the time is advanced withrespect to standard time when the daylight saving rules are ineffect, or 0 (zero) if this time zone doesn't observe daylightsaving time.
See Also:   SimpleTimeZone.setDSTSavings
since:
   1.2



getOffset
public int getOffset(long date)(Code)
Returns the offset of this time zone from UTC at the given time. If daylight saving time is in effect at the given time, the offset value is adjusted with the amount of daylight saving.
Parameters:
  date - the time at which the time zone offset is found the amount of time in milliseconds to add to UTC to getlocal time.
since:
   1.4



getOffset
public int getOffset(int era, int year, int month, int day, int dayOfWeek, int millis)(Code)
Returns the difference in milliseconds between local time and UTC, taking into account both the raw offset and the effect of daylight saving, for the specified date and time. This method assumes that the start and end month are distinct. It also uses a default GregorianCalendar object as its underlying calendar, such as for determining leap years. Do not use the result of this method with a calendar other than a default GregorianCalendar.

Note: In general, clients should use Calendar.get(ZONE_OFFSET) + Calendar.get(DST_OFFSET) instead of calling this method.
Parameters:
  era - The era of the given date.
Parameters:
  year - The year in the given date.
Parameters:
  month - The month in the given date. Month is 0-based. e.g.,0 for January.
Parameters:
  day - The day-in-month of the given date.
Parameters:
  dayOfWeek - The day-of-week of the given date.
Parameters:
  millis - The milliseconds in day in standard local time. The milliseconds to add to UTC to get local time.
exception:
  IllegalArgumentException - the era,month, day, dayOfWeek,or millis parameters are out of range




getOffsets
int getOffsets(long date, int[] offsets)(Code)

See Also:   TimeZone.getOffsets



getRawOffset
public int getRawOffset()(Code)
Gets the GMT offset for this time zone. the GMT offset value in milliseconds
See Also:   SimpleTimeZone.setRawOffset



hasSameRules
public boolean hasSameRules(TimeZone other)(Code)
Returns true if this zone has the same rules and offset as another zone.
Parameters:
  other - the TimeZone object to be compared with true if the given zone is a SimpleTimeZone and has thesame rules and offset as this one
since:
   1.2



hashCode
public synchronized int hashCode()(Code)
Generates the hash code for the SimpleDateFormat object. the hash code for this object



inDaylightTime
public boolean inDaylightTime(Date date)(Code)
Queries if the given date is in daylight saving time. true if daylight saving time is in effective at thegiven date; false otherwise.



setDSTSavings
public void setDSTSavings(int millisSavedDuringDST)(Code)
Sets the amount of time in milliseconds that the clock is advanced during daylight saving time.
Parameters:
  millisSavedDuringDST - the number of milliseconds the time isadvanced with respect to standard time when the daylight saving time rulesare in effect. A positive number, typically one hour (3600000).
See Also:   SimpleTimeZone.getDSTSavings
since:
   1.2



setEndRule
public void setEndRule(int endMonth, int endDay, int endDayOfWeek, int endTime)(Code)
Sets the daylight saving time end rule. For example, if daylight saving time ends on the last Sunday in October at 2 am in wall clock time, you can set the end rule by calling: setEndRule(Calendar.OCTOBER, -1, Calendar.SUNDAY, 2*60*60*1000);
Parameters:
  endMonth - The daylight saving time ending month. Month isa Calendar.MONTH MONTH fieldvalue (0-based. e.g., 9 for October).
Parameters:
  endDay - The day of the month on which the daylight saving time ends.See the class description for the special cases of this parameter.
Parameters:
  endDayOfWeek - The daylight saving time ending day-of-week.See the class description for the special cases of this parameter.
Parameters:
  endTime - The daylight saving ending time in local wall clock time,(in milliseconds within the day) which is local daylighttime in this case.
exception:
  IllegalArgumentException - if the endMonth, endDay,endDayOfWeek, or endTime parameters are out of range



setEndRule
public void setEndRule(int endMonth, int endDay, int endTime)(Code)
Sets the daylight saving time end rule to a fixed date within a month. This method is equivalent to:
setEndRule(endMonth, endDay, 0, endTime)

Parameters:
  endMonth - The daylight saving time ending month. Month isa Calendar.MONTH MONTH fieldvalue (0-based. e.g., 9 for October).
Parameters:
  endDay - The day of the month on which the daylight saving time ends.
Parameters:
  endTime - The daylight saving ending time in local wall clock time,(in milliseconds within the day) which is local daylighttime in this case.
exception:
  IllegalArgumentException - the endMonth, endDay,or endTime parameters are out of range
since:
   1.2



setEndRule
public void setEndRule(int endMonth, int endDay, int endDayOfWeek, int endTime, boolean after)(Code)
Sets the daylight saving time end rule to a weekday before or after the given date within a month, e.g., the first Monday on or after the 8th.
Parameters:
  endMonth - The daylight saving time ending month. Month isa Calendar.MONTH MONTH fieldvalue (0-based. e.g., 9 for October).
Parameters:
  endDay - The day of the month on which the daylight saving time ends.
Parameters:
  endDayOfWeek - The daylight saving time ending day-of-week.
Parameters:
  endTime - The daylight saving ending time in local wall clock time,(in milliseconds within the day) which is local daylighttime in this case.
Parameters:
  after - If true, this rule selects the first endDayOfWeek onor after endDay. If false, this ruleselects the last endDayOfWeek on or beforeendDay of the month.
exception:
  IllegalArgumentException - the endMonth, endDay,endDayOfWeek, or endTime parameters are out of range
since:
   1.2



setRawOffset
public void setRawOffset(int offsetMillis)(Code)
Sets the base time zone offset to GMT. This is the offset to add to UTC to get local time.
See Also:   SimpleTimeZone.getRawOffset



setStartRule
public void setStartRule(int startMonth, int startDay, int startDayOfWeek, int startTime)(Code)
Sets the daylight saving time start rule. For example, if daylight saving time starts on the first Sunday in April at 2 am in local wall clock time, you can set the start rule by calling:
setStartRule(Calendar.APRIL, 1, Calendar.SUNDAY, 2*60*60*1000);

Parameters:
  startMonth - The daylight saving time starting month. Month isa Calendar.MONTH MONTH fieldvalue (0-based. e.g., 0 for January).
Parameters:
  startDay - The day of the month on which the daylight saving time starts.See the class description for the special cases of this parameter.
Parameters:
  startDayOfWeek - The daylight saving time starting day-of-week.See the class description for the special cases of this parameter.
Parameters:
  startTime - The daylight saving time starting time in local wall clocktime, which is local standard time in this case.
exception:
  IllegalArgumentException - if the startMonth, startDay,startDayOfWeek, or startTime parameters are out of range



setStartRule
public void setStartRule(int startMonth, int startDay, int startTime)(Code)
Sets the daylight saving time start rule to a fixed date within a month. This method is equivalent to:
setStartRule(startMonth, startDay, 0, startTime)

Parameters:
  startMonth - The daylight saving time starting month. Month isa Calendar.MONTH MONTH fieldvalue (0-based. e.g., 0 for January).
Parameters:
  startDay - The day of the month on which the daylight saving time starts.
Parameters:
  startTime - The daylight saving time starting time in local wall clocktime, which is local standard time in this case.See the class description for the special cases of this parameter.
exception:
  IllegalArgumentException - if the startMonth,startDayOfMonth, or startTime parameters are out of range
since:
   1.2



setStartRule
public void setStartRule(int startMonth, int startDay, int startDayOfWeek, int startTime, boolean after)(Code)
Sets the daylight saving time start rule to a weekday before or after the given date within a month, e.g., the first Monday on or after the 8th.
Parameters:
  startMonth - The daylight saving time starting month. Month isa Calendar.MONTH MONTH fieldvalue (0-based. e.g., 0 for January).
Parameters:
  startDay - The day of the month on which the daylight saving time starts.
Parameters:
  startDayOfWeek - The daylight saving time starting day-of-week.
Parameters:
  startTime - The daylight saving time starting time in local wall clocktime, which is local standard time in this case.
Parameters:
  after - If true, this rule selects the first dayOfWeek on orafter dayOfMonth. If false, this ruleselects the last dayOfWeek on or beforedayOfMonth.
exception:
  IllegalArgumentException - if the startMonth, startDay,startDayOfWeek, or startTime parameters are out of range
since:
   1.2



setStartYear
public void setStartYear(int year)(Code)
Sets the daylight saving time starting year.
Parameters:
  year - The daylight saving starting year.



toString
public String toString()(Code)
Returns a string representation of this time zone. a string representation of this time zone.



useDaylightTime
public boolean useDaylightTime()(Code)
Queries if this time zone uses daylight saving time. true if this time zone uses daylight saving time;false otherwise.



Fields inherited from java.util.TimeZone
final static String GMT_ID(Code)(Java Doc)
final public static int LONG(Code)(Java Doc)
final static TimeZone NO_TIMEZONE(Code)(Java Doc)
final public static int SHORT(Code)(Java Doc)
final static long serialVersionUID(Code)(Java Doc)

Methods inherited from java.util.TimeZone
public Object clone()(Code)(Java Doc)
public static synchronized String[] getAvailableIDs(int rawOffset)(Code)(Java Doc)
public static synchronized String[] getAvailableIDs()(Code)(Java Doc)
public int getDSTSavings()(Code)(Java Doc)
public static TimeZone getDefault()(Code)(Java Doc)
static TimeZone getDefaultRef()(Code)(Java Doc)
final public String getDisplayName()(Code)(Java Doc)
final public String getDisplayName(Locale locale)(Code)(Java Doc)
final public String getDisplayName(boolean daylight, int style)(Code)(Java Doc)
public String getDisplayName(boolean daylight, int style, Locale locale)(Code)(Java Doc)
public String getID()(Code)(Java Doc)
abstract public int getOffset(int era, int year, int month, int day, int dayOfWeek, int milliseconds)(Code)(Java Doc)
public int getOffset(long date)(Code)(Java Doc)
int getOffsets(long date, int[] offsets)(Code)(Java Doc)
abstract public int getRawOffset()(Code)(Java Doc)
public static synchronized TimeZone getTimeZone(String ID)(Code)(Java Doc)
public boolean hasSameRules(TimeZone other)(Code)(Java Doc)
abstract public boolean inDaylightTime(Date date)(Code)(Java Doc)
public static void setDefault(TimeZone zone)(Code)(Java Doc)
public void setID(String ID)(Code)(Java Doc)
abstract public void setRawOffset(int offsetMillis)(Code)(Java Doc)
abstract public boolean useDaylightTime()(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.