| |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
fipaos.util.UTCContainer | +--fipaos.util.UTCTime
This is a class which can be used to directly manipulate UTC
time strings in a consitant manner. Due to the unreliablility
of information about which timezone the user is in from Java,
details of the local timezone are picked up from a user.profile
file in the currect directory (this is not an ideal solution
since the information should really come from some form of roaming
profile). An example of the user.profile file is given below
User profile. Includes user specific information about
the timezone they are working in (at a future date this
should be picked up from the user's roaming profile)
Local timezone offset from Z (GMT) excluding DST
TimeZoneOffset = 0
Offset from normal local timezone during DST
If this is omitted or == 0, DST is not used
DSTOffset = 1.0
Details about when DST should start
DSTStartMonth indicates the starting month of DST, and should
be in the range 1 to 12
DSTStartWeekOfMonth indicates which week of the month DST should
start. Negative values are relative to the end of the month.
DSTStartDayOfWeek indicates which day of the week DST should start.
This should be in the range 0 to 6, with 0 being Sunday and 6 being
Saturday (e.g. 2 = Tuesday)
DSTStartHourOfDay indicates at which hour of the day (24 hour format)
the change should occur. This should be in the range 0 to 23
DSTStartMonth = 3
DSTStartWeekOfMonth = -1
DSTStartDayOfWeek = 0
DSTStartHourOfDay = 2
Details about when DST should end. Similar to DSTStart
properties above
DSTEndMonth = 10
DSTEndWeekOfMonth = -1
DSTEndDayOfWeek = 0
DSTEndHourOfDay = 2
Use of set method
a problem can occur when setting the MONTH attibute
if the DATE attribute is after the last day of the month eg.30th when the
month is February this will have the effect of incrementing the month
this can be avoided bysetting the DATE atribute to below the last day of the MONTH
before setting the MONTH attribute
Fields inherited from class fipaos.util.UTCContainer |
DATE, HOUR, MILLISECOND, MINUTE, MONTH, SECOND, YEAR |
Constructor Summary | |
UTCTime(String time) Constructs a UTCTime object given a UTC string of the form 19990427T1200Z or 19990427T120000Z. | |
UTCTime(int year, int month, int date, int hour, int minute, int second, int millis, String time_zone) Constructs a UTCTime object from the given parameters | |
UTCTime() Constructs a UTCTime object to represent the current time |
Method Summary | |
void | add(int field, int value) Method to allow addition/subtraction from an element of the date |
void | addDuration(UTCDuration duration) Method to allow addition of a UTCDuration to this UTCTime object Fields are added from least significant to most significant field |
void | changeTimeZone(String new_zone) Change timezone from the current to the one specified. |
boolean | equals(UTCTime time) Method to provide a mechanism for determining if two times are the same |
int | getDayOfWeek() returns the day of the week as an integer sunday - 1, monday - 2 .....saturday - 7 |
long | getTimeInMillis() Returns the number of milliseconds since 19700101T0000 in the timezone of this UTCTime object |
String | getTimeZone() Method to retreive the timezone of the UTCTime object |
UTCTime | getZTime() Method to return a representation of this object in Z time |
boolean | isAfter(UTCTime time) Method to provide a way of determining if a UTCTime object represents a time before the time this UTCTime instance represents. |
boolean | isBefore(UTCTime time) Method to provide a way of determining if a UTCTime object represents a time after the time this UTCTime instance represents |
static void | main(String[] args) |
void | set(int field, int value) Method to allow manual setting of date/time fields All fields will be re-validated before this method returns |
void | setTimeZone(String timezone) Method to allow change of timezone |
String | toString() Overrides default Object.toString() |
Methods inherited from class fipaos.util.UTCContainer |
clone, equals, get, isAfter, isBefore, setAccuracy |
Constructor Detail |
public UTCTime(String time)
public UTCTime(int year, int month, int date, int hour, int minute, int second, int millis, String time_zone)
public UTCTime()
Method Detail |
public void add(int field, int value)
public void addDuration(UTCDuration duration)
public void changeTimeZone(String new_zone)
public boolean equals(UTCTime time)
public int getDayOfWeek()
public long getTimeInMillis()
public String getTimeZone()
public UTCTime getZTime()
public boolean isAfter(UTCTime time)
public boolean isBefore(UTCTime time)
public static void main(String[] args)
public void set(int field, int value)
public void setTimeZone(String timezone)
public String toString()
Association Links |
to Class java.util.Hashtable
to Class java.lang.String
| |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |