public class DateTime
Constructor Summary |
---|
DateTime(intyear, intmonth, intday)
Initializes a new instance of the DateTime object to the specified year, month, and day. |
DateTime(intyear, intmonth, intday, inthour, intminute, intsecond)
Initializes a new instance of the DateTime object to the specified year, month, day, hour, minute, and second. |
DateTime(intyear, intmonth, intday, inthour, intminute, intsecond, intmillisecond)
Initializes a new instance of the DateTime object to the specified year, month, day, hour, minute, second, and millisecond. |
DateTime(java.util.Datedate)
Initializes a new instance of the DateTime object to the specified Date object |
DateTime(java.util.Calendarcld)
Initializes a new instance of the DateTime object to the specified Calendar object |
Method Summary | ||
---|---|---|
DateTime | addDays(double value) | |
Adds the specified number of days to the value of this instance.
|
||
DateTime | addHours(double value) | |
Adds the specified number of hours to the value of this instance.
|
||
DateTime | addMilliseconds(double value) | |
Adds the specified number of milliseconds to the value of this instance.
|
||
DateTime | addMinutes(double value) | |
Adds the specified number of minutes to the value of this instance.
|
||
DateTime | addMonths(int months) | |
Adds the specified number of months to the value of this instance.
|
||
DateTime | addSeconds(double value) | |
Adds the specified number of seconds to the value of this instance.
|
||
DateTime | addYears(int value) | |
Adds the specified number of years to the value of this instance.
|
||
int | compareTo(DateTime value) | |
Compares the value of this instance to a specified DateTime value
and returns an integer that indicates whether this instance is earlier than,
the same as, or later than the specified DateTime value.
|
||
int | compareTo(java.lang.Object value) | |
Compares the value of this instance to a specified object that contains a
specified DateTime value, and returns an integer that indicates whether
this instance is earlier than, the same as, or later than the specified DateTime value.
|
||
boolean | equals(java.lang.Object value) | |
Returns a value indicating whether this instance is equal to a specified object.
|
||
int | getDay() | |
Gets the day of the month represented by this instance.
|
||
int | getDayOfWeek() | |
Gets the day of the week represented by this instance.
|
||
int | getDayOfYear() | |
Gets the day of the year represented by this instance.
|
||
int | getHour() | |
Gets the hour component of the date represented by this instance.
|
||
int | getMillisecond() | |
Gets the milliseconds component of the date represented by this instance.
|
||
int | getMinute() | |
Gets the minute component of the date represented by this instance.
|
||
int | getMonth() | |
Gets the month component of the date represented by this instance.
|
||
static DateTime | getNow() | |
Gets a DateTime object that is set to the current date and time on this computer, expressed as the local time.
|
||
int | getSecond() | |
Gets the seconds component of the date represented by this instance.
|
||
int | getYear() | |
Gets the year component of the date represented by this instance.
|
||
int | hashCode() | |
Returns the hash code for this instance.
|
||
java.util.Calendar | toCalendar() | |
Converts the value of the current DateTime object to Calendar object.
|
||
java.util.Date | toDate() | |
Converts the value of the current DateTime object to Date object.
|
||
DateTime | toLocalTime() | |
Converts the value of the current DateTime object to local time.
|
||
java.lang.String | toString() | |
Converts the value of the current DateTime object to its equivalent string representation.
|
||
DateTime | toUniversalTime() | |
Converts the value of the current DateTime object to Coordinated Universal Time(UTC).
|
public DateTime(int year, int month, int day)
year
- The year (1 through 9999).month
- The month (1 through 12).day
- The day (1 through the number of days in month).public DateTime(int year, int month, int day, int hour, int minute, int second)
year
- The year (1 through 9999).month
- The month (1 through 12).day
- The day (1 through the number of days in month).hour
- The hours (0 through 23).minute
- The minutes (0 through 59).second
- The seconds (0 through 59).public DateTime(int year, int month, int day, int hour, int minute, int second, int millisecond)
year
- The year (1 through 9999).month
- The month (1 through 12).day
- The day (1 through the number of days in month).hour
- The hours (0 through 23).minute
- The minutes (0 through 59).second
- The seconds (0 through 59).millisecond
- The milliseconds (0 through 999).public DateTime(java.util.Date date)
date
- The Date objectpublic DateTime(java.util.Calendar cld)
cld
- The Calendar objectpublic java.util.Date toDate()
public java.util.Calendar toCalendar()
public DateTime toUniversalTime()
public DateTime toLocalTime()
public DateTime addDays(double value)
value
- A number of whole and fractional days. The value parameter can be negative or positive.public DateTime addHours(double value)
value
- A number of whole and fractional hours. The value parameter can be negative or positive.public DateTime addMilliseconds(double value)
value
- A number of whole and fractional milliseconds. The value parameter can be negative or positive. Note that this value is rounded to the nearest integer.public DateTime addMinutes(double value)
value
- A number of whole and fractional minutes. The value parameter can be negative or positive.public DateTime addMonths(int months)
months
- A number of months. The months parameter can be negative or positive.public DateTime addSeconds(double value)
value
- A number of whole and fractional seconds. The value parameter can be negative or positive.public DateTime addYears(int value)
value
- A number of years. The value parameter can be negative or positive.public int compareTo(java.lang.Object value)
value
- A boxed DateTime object to compare, or null.public int compareTo(DateTime value)
value
- A DateTime object to compare.public int hashCode()
public boolean equals(java.lang.Object value)
value
- An object to compare to this instance.public int getDay()
public int getDayOfWeek()
public int getDayOfYear()
public int getHour()
public int getMillisecond()
public int getMinute()
public int getMonth()
public static DateTime getNow()
public int getSecond()
public int getYear()
public java.lang.String toString()