org.mbari.util
Class GmtCalendar

java.lang.Object
  extended byjava.util.Calendar
      extended byjava.util.GregorianCalendar
          extended byorg.mbari.util.GmtCalendar
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public class GmtCalendar
extends java.util.GregorianCalendar

GmtCalendar is a useful class for working with times that are based using GMT time. For example, if a data loger collects info and returns it as GMT using GregorianCalendar is a pain because it will assumes that user supplied times are from the default TimeZone. This will cause an ofset in the time of each data sample. To avoid this GmtCalendar uses the GMT as it's default TimeZone. Note that it will return time in milliseconds UTC but any dates produced by using DateFormat will give the sample time based on the local time.

Version:
30 Nov 1999
Author:
Brian Schlining
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.GregorianCalendar
AD, BC
 
Fields inherited from class java.util.Calendar
AM, AM_PM, APRIL, areFieldsSet, AUGUST, DATE, DAY_OF_MONTH, DAY_OF_WEEK, DAY_OF_WEEK_IN_MONTH, DAY_OF_YEAR, DECEMBER, DST_OFFSET, ERA, FEBRUARY, FIELD_COUNT, fields, FRIDAY, HOUR, HOUR_OF_DAY, isSet, isTimeSet, JANUARY, JULY, JUNE, MARCH, MAY, MILLISECOND, MINUTE, MONDAY, MONTH, NOVEMBER, OCTOBER, PM, SATURDAY, SECOND, SEPTEMBER, SUNDAY, THURSDAY, time, TUESDAY, UNDECIMBER, WEDNESDAY, WEEK_OF_MONTH, WEEK_OF_YEAR, YEAR, ZONE_OFFSET
 
Constructor Summary
GmtCalendar(java.util.Date date)
          Constructor for the GmtCalendar object
GmtCalendar(int year, int month, int date)
          Constructs a GmtCalendar with the given date set in the GMT time zone with the default locale.
GmtCalendar(int year, int month, int date, int hour, int minute)
          Constructs a GregorianCalendar with the given date and time set for the GMT time zone with the default locale.
GmtCalendar(int year, int month, int date, int hour, int minute, int second)
          Constructs a GregorianCalendar with the given date and time set for the GMT time zone with the default locale.
GmtCalendar(long millisec)
          Constructor for the GmtCalendar object
 
Methods inherited from class java.util.GregorianCalendar
add, computeFields, computeTime, equals, getActualMaximum, getActualMinimum, getGreatestMinimum, getGregorianChange, getLeastMaximum, getMaximum, getMinimum, hashCode, isLeapYear, roll, roll, setGregorianChange
 
Methods inherited from class java.util.Calendar
after, before, clear, clear, clone, complete, get, getAvailableLocales, getFirstDayOfWeek, getInstance, getInstance, getInstance, getInstance, getMinimalDaysInFirstWeek, getTime, getTimeInMillis, getTimeZone, internalGet, isLenient, isSet, set, set, set, set, setFirstDayOfWeek, setLenient, setMinimalDaysInFirstWeek, setTime, setTimeInMillis, setTimeZone, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GmtCalendar

public GmtCalendar(int year,
                   int month,
                   int date)
Constructs a GmtCalendar with the given date set in the GMT time zone with the default locale.

Parameters:
year - the value used to set the YEAR time field in the calendar.
month - the value used to set the MONTH time field in the calendar. Month value is 0-based. e.g., 0 for January.
date - the value used to set the DATE time field in the calendar.

GmtCalendar

public GmtCalendar(int year,
                   int month,
                   int date,
                   int hour,
                   int minute)
Constructs a GregorianCalendar with the given date and time set for the GMT time zone with the default locale.

Parameters:
year - the value used to set the YEAR time field in the calendar.
month - the value used to set the MONTH time field in the calendar. Month value is 0-based. e.g., 0 for January.
date - the value used to set the DATE time field in the calendar.
hour - the value used to set the HOUR_OF_DAY time field in the calendar.
minute - the value used to set the MINUTE time field in the calendar.

GmtCalendar

public GmtCalendar(int year,
                   int month,
                   int date,
                   int hour,
                   int minute,
                   int second)
Constructs a GregorianCalendar with the given date and time set for the GMT time zone with the default locale.

Parameters:
year - the value used to set the YEAR time field in the calendar.
month - the value used to set the MONTH time field in the calendar. Month value is 0-based. e.g., 0 for January.
date - the value used to set the DATE time field in the calendar.
hour - the value used to set the HOUR_OF_DAY time field in the calendar.
minute - the value used to set the MINUTE time field in the calendar.
second - the value used to set the SECOND time field in the calendar.

GmtCalendar

public GmtCalendar(java.util.Date date)
Constructor for the GmtCalendar object

Parameters:
date - Description of the Parameter

GmtCalendar

public GmtCalendar(long millisec)
Constructor for the GmtCalendar object

Parameters:
millisec - Description of the Parameter