public final class MIDateTime extends Object implements Comparable, Serializable
GregorianCalendar except for the month which is expressed as a
1-based integer. 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).Month,
GregorianCalendar,
Serialized Form| Constructor and Description |
|---|
MIDateTime(int year,
int month,
int day,
int hour,
int minute,
double seconds)
Constructs a new instance.
|
MIDateTime(long milliSeconds)
Constructs a new instance.
|
MIDateTime(MIDate date,
MITime time)
Constructs a new instance as the concatenation of a date and a time.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(MIDateTime dateTime) |
boolean |
equals(Object o)
Indicates whether some other object is "equal to" this one.
|
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.
|
int |
getYear()
Returns the year.
|
int |
hashCode()
Returns a hash code value for the object.
|
String |
toString()
Returns the date and time in MM/DD/YY hh:mm:ss format.
|
public MIDateTime(int year,
int month,
int day,
int hour,
int minute,
double seconds)
year - the year in the Gregorian calendarmonth - the month. Use the Month constants such as Month.FEBRUARY.day - the day of the month.hour - the hourminute - the minutes of the hourseconds - the seconds.public MIDateTime(MIDate date, MITime time)
date - the datetime - the timepublic MIDateTime(long milliSeconds)
Calendar.getTimeInMillis()
or System.currentTimeMillis().milliSeconds - time in milliseconds to use to initialize this instance.public long getTimeInMilliSeconds()
Calendarpublic int getYear()
public int getMonth()
Month class (for example, Month.JANUARY).public int getDay()
public int getHour()
public int getMinute()
public double getSeconds()
public int compareTo(MIDateTime dateTime)
compareTo in interface Comparablepublic boolean equals(Object o)
public int hashCode()
© 2007, 2022 Precisely. All rights reserved.