Intel

Developer Zone

TimeZone


com.intel.util
Class TimeZone

java.lang.Object
  extended by com.intel.util.TimeZone

public class TimeZone
extends java.lang.Object

This class represents a time zone and provides a method to calculate the time zone offset from GMT. It can be used by applets when configuring their time notion using Calendar objects.

See Also:
Calendar

Constructor Summary
TimeZone()
Default Constructor.
TimeZone(byte hours, boolean halfHourAdjust, boolean dayLightSaving)
Constructor - Creates a TimeZone instance with the given parameters.
Method Summary
int getRawOffset()
Returns the raw offset (in seconds) which needs to be added to GMT to get the local time.
Methods inherited from class java.lang.Object
equals, hashCode, toString

Constructor Detail

TimeZone

public TimeZone(byte hours,
                boolean halfHourAdjust,
                boolean dayLightSaving)
         throws UtilException
Constructor - Creates a TimeZone instance with the given parameters.

Parameters:
hours - represents the deviation (in hours) of the local time from GMT (can be a positive or a negative number)
halfHourAdjust - if true, adds half an hour to the local time calculation. For example, if hours=(+5) then the time will be GMT +5:30; if hours=(-5) then the time will be GMT -4:30.
dayLightSaving - if true, applies the daylight saving scheme when calculating the local time (adds one hour to the local time calculation)
Throws:
IllegalParameterException - if the hours value isn't in the allowed range [-11, 14]
UtilException

TimeZone

public TimeZone()
Default Constructor. Creates a default instance of TimeZone with GMT as the value.

Method Detail

getRawOffset

public int getRawOffset()
Returns the raw offset (in seconds) which needs to be added to GMT to get the local time.

Returns:
raw offset in seconds