Search
DateTime Methods
 


 Public Methods

  Name Description

add

Returns a new DateTime that adds the value of the specified Duration to the value of this instance.

addDays

Overloaded. Returns a new DateTime that adds the specified number of days to this instance.

addHours

Overloaded. Returns a new DateTime that adds the specified number of hours to this instance.

addMilliseconds

Overloaded. Returns a new DateTime that adds the specified number of milliseconds to this instance.

addMinutes

Overloaded. Returns a new DateTime that adds the specified number of minutes to this instance.

addMonths

Overloaded. Returns a new DateTime that adds the specified number of months to this instance.

addSeconds

Overloaded. Returns a new DateTime that adds the specified number of seconds to this instance.

addTicks

Returns a new DateTime that adds the specified number of ticks to this instance.

addYears

Returns a new DateTime that adds the specified number of years to this instance.

clone

Cloneable.clone implementation.

compareTo

Comparable.compareTo implementation.

daysInMonth

Returns the number of days in the specified month and year.

equals

Object.equals override.

getDate

Gets the date component of this instance.

getDay

Gets the day of month component of the date (1-31).

getDayOfWeek

Gets the day of the week represented by this instance.

getDayOfYear

Gets the day of the year represented by this instance.

getHour

Gets the hour component of the date (0-23).

getMillisecond

Gets the millisecond component of the date (0-999).

getMinute

Gets the minute component of the date (0-59).

getMonth

Gets the month component of the date (1-12).

getSecond

Gets the second component of the date (0-59).

getTicks

Gets the total number of ticks in this instance.

getTimeOfDay

Gets the time of the day of this instance.

getWeekOfYear

Gets the week of the year for the current date.

getYear

Gets the year component of the date.

hashCode

Object.hashCode override.

isLeapYear

Returns a value indicating whether the specified year is a leap year.

isLessThan

Determines whether the current DateTime is less than the specified DateTime.

isLessThanOrEqual

Determines whether the current DateTime is less than or equal to the specified DateTime.

isLocalTime

Gets a value indicating whether the time represented by this instance is a local time.

isUtcTime

Gets a value indicating whether the time represented by this instance is a UTC time.

isWeekend

 

now

Gets a DateTime object that is set to the current date and time in the default time zone and locale.

op_Addition

Adds a specified time interval to a specified date and time, yielding a new date and time.

op_Equality

Determines whether two specified instances of DateTime are equal.

op_GreaterThan

Determines whether one specified DateTime is greater than another specified DateTime.

op_GreaterThanOrEqual

Determines whether one specified DateTime is greater than or equal to another specified DateTime.

op_Inequality

Determines whether two specified instances of DateTime are not equal.

op_LessThan

Determines whether one specified DateTime is less than another specified DateTime.

op_LessThanOrEqual

Determines whether one specified DateTime is less than or equal to another specified DateTime.

op_Subtraction

Overloaded.  

subtract

Overloaded.  

today

Gets a DateTime object that represents the current date in the default time one and locale.

toJavaCalendar

Converts the stored date and time to a Calendar object.

toJavaDateTime

Returns the stored LocalDateTime value.

toLocalTime

Converts the value of the current DateTime object to local time.

toLongDateString

Overloaded.  

toLongTimeString

Overloaded.  

toShortDateString

Overloaded.  

toShortTimeString

Overloaded.  

toString

Overloaded. Converts the value of the current DateTime object to its equivalent string representation.

toUniversalTime

Converts the value of the current DateTime object to Coordinated Universal Time (UTC).

utcNow

Gets a DateTime object that is set to the current date and time on this computer, expressed as the Coordinated Universal Time (UTC).

 See Also