com.mapinfo.midev.type

## Class MIDateTimeZone

- java.lang.Object
- - com.mapinfo.midev.type.MIDateTimeZone

All Implemented Interfaces:
  Serializable, Comparable

    public final class MIDateTimeZone
    extends Object
    implements Comparable, Serializable

Represents a date and time in a specific timezone in the Gregorian calendar. Years, months, days, hours, minutes and timezones are specified in the same way they would be specified in the GregorianCalendar except for the month which is 1-based. For example, January is month 1, etc. Use the `Month` constants for month names to avoid confusion and increase readability. Seconds are specified as a double, however, the value is only significant to three decimal places (milliseconds).

See Also:
  `Month`, `GregorianCalendar`, Serialized Form

### Constructor Summary

Constructors
Constructor and Description
`MIDateTimeZone(int year, int month, int day, int hour, int minute, double seconds, TimeZone timezone)` Constructs a new instance.
`MIDateTimeZone(long milliSeconds, TimeZone timezone)` Constructs a new instance.
`MIDateTimeZone(MIDate date, MITime time, TimeZone timezone)` Constructs a new instance as a concatenation of a date, time, and timezone.
`MIDateTimeZone(MIDateTime date, TimeZone timezone)` Constructs a new instance as a concatenation of a MIDateTime and a TimeZone.

### Method Summary

All Methods Instance Methods Concrete Methods
`int` `compareTo(MIDateTimeZone dateTime)`
`boolean` `equals(Object o)`
`int` `getDay()` Returns the day of the month.
`int` `getHour()` Returns the hour
`int` `getMinute()` Returns the minute of the hour.
`int` `getMonth()` Returns the month.
`double` `getSeconds()` Returns the seconds.
`long` `getTimeInMilliSeconds()` Returns the date and time as the number of milliseconds since the Epoch.
`TimeZone` `getTimeZone()` Returns the timezone.
`int` `getYear()` Returns the year.
`int` `hashCode()`
`String` `toString()` Returns the date time and timezone as MM/DD/YY hh:mm:ss z format.

### Methods inherited from class java.lang.Object

`getClass, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### MIDateTimeZone

    public MIDateTimeZone(int year,
                          int month,
                          int day,
                          int hour,
                          int minute,
                          double seconds,
                          TimeZone timezone)

Constructs a new instance.

Parameters:
  `year` - the year in the Gregorian calendar
  `month` - the month. Use the `Month` constants such as Month.FEBRUARY.
  `day` - the day of the month.
  `hour` - the hour
  `minute` - the minutes of the hour
  `seconds` - the seconds.
  `timezone` - the timezone

#### MIDateTimeZone

    public MIDateTimeZone(MIDateTime date,
                          TimeZone timezone)

Constructs a new instance as a concatenation of a MIDateTime and a TimeZone.

Parameters:
  `date` - the date and time
  `timezone` - the timezone

#### MIDateTimeZone

    public MIDateTimeZone(MIDate date,
                          MITime time,
                          TimeZone timezone)

Constructs a new instance as a concatenation of a date, time, and timezone.

Parameters:
  `date` - the date
  `time` - the time
  `timezone` - the timezone

#### MIDateTimeZone

    public MIDateTimeZone(long milliSeconds,
                          TimeZone timezone)

Constructs a new instance. The date and time fields are initialized from the appropriate values in the supplied time in milliseconds. This time is consistent with values obtained from `Calendar.getTimeInMillis()` or `System.currentTimeMillis()`.

Parameters:
  `milliSeconds` - time in milliseconds to use to initialize this instance.
  `timezone` - the timezone this time is expressed in

### Method Detail

#### getTimeInMilliSeconds

    public long getTimeInMilliSeconds()

Returns the date and time as the number of milliseconds since the Epoch.

Returns:
  the date and time as the difference in milliseconds from the Epoch.
See Also:
  `Calendar`

#### getYear

    public int getYear()

Returns the year.

Returns:
  the year

#### getMonth

    public int getMonth()

Returns the month. Months are expressed in terms of the constants defined in the `Month` class (for example, `Month.JANUARY`).

Returns:
  the month

#### getDay

    public int getDay()

Returns the day of the month.

Returns:
  the day of the month.

#### getHour

    public int getHour()

Returns the hour

Returns:
  the hour.

#### getMinute

    public int getMinute()

Returns the minute of the hour.

Returns:
  the minute of the hour.

#### getSeconds

    public double getSeconds()

Returns the seconds. The seconds supplied are retained and returned by this method. However, equality are comparisons are sensitive to milliseconds only.

Returns:
  the seconds.

#### getTimeZone

    public TimeZone getTimeZone()

Returns the timezone.

Returns:
  the timezone.

#### compareTo

    public int compareTo(MIDateTimeZone dateTime)

Specified by:
  `compareTo` in interface `Comparable`

#### equals

    public boolean equals(Object o)

Overrides:
  `equals` in class `Object`

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `Object`

#### toString

    public String toString()

Returns the date time and timezone as MM/DD/YY hh:mm:ss z format.

Overrides:
  `toString` in class `Object`
Returns:
  the date time and timezone as MM/DD/YY hh:mm:ss z format.