Initializes a new instance of the System.DateTime structure to a specified number of ticks.
A date and time expressed in the number of 100-nanosecond intervals that have elapsed since January 1, 0001 at 00:00:00.000 in the Gregorian calendar.
Initializes a new instance of the System.DateTime structure to a specified number of ticks and to Coordinated Universal Time (UTC) or local time.
A date and time expressed in the number of 100-nanosecond intervals that have elapsed since January 1, 0001 at 00:00:00.000 in the Gregorian calendar.
One of the enumeration values that indicates whether ticks specifies a local time, Coordinated Universal Time (UTC), or neither.
Static
Readonly
MaxRepresents the largest possible value of System.DateTime. This field is read-only.
Static
Readonly
MinRepresents the smallest possible value of System.DateTime. This field is read-only.
Gets the day of the month represented by this instance.
The day component, expressed as a value between 1 and 31.
Gets the day of the week represented by this instance.
An enumerated constant that indicates the day of the week of this System.DateTime value.
Gets the day of the year represented by this instance.
The day of the year, expressed as a value between 1 and 366.
Gets the hour component of the date represented by this instance.
The hour component, expressed as a value between 0 and 23.
Gets a value that indicates whether the time represented by this instance is based on local time, Coordinated Universal Time (UTC), or neither.
One of the enumeration values that indicates what the current time represents. The default is System.DateTimeKind.Unspecified.
Gets the milliseconds component of the date represented by this instance.
The milliseconds component, expressed as a value between 0 and 999.
Gets the minute component of the date represented by this instance.
The minute component, expressed as a value between 0 and 59.
Gets the month component of the date represented by this instance.
The month component, expressed as a value between 1 and 12.
Gets the seconds component of the date represented by this instance.
The seconds component, expressed as a value between 0 and 59.
Gets the number of ticks that represent the date and time of this instance.
The number of ticks that represent the date and time of this instance. The value is between DateTime.MinValue.Ticks and DateTime.MaxValue.Ticks.
Gets the year component of the date represented by this instance.
The year, between 1 and 9999.
Static
NowGets a System.DateTime object that is set to the current date and time on this computer, expressed as the local time.
An object whose value is the current local date and time.
Static
TodayStatic
UtcGets a System.DateTime object that is set to the current date and time on this computer, expressed as the Coordinated Universal Time (UTC).
An object whose value is the current UTC date and time.
Returns a new System.DateTime that adds the value of the specified System.TimeSpan to the value of this instance.
A positive or negative time interval.
An object whose value is the sum of the date and time represented by this instance and the time interval represented by value.
Returns a new System.DateTime that adds the specified number of days to the value of this instance.
A number of whole and fractional days. The value parameter can be negative or positive.
An object whose value is the sum of the date and time represented by this instance and the number of days represented by value.
Returns a new System.DateTime that adds the specified number of hours to the value of this instance.
A number of whole and fractional hours. The value parameter can be negative or positive.
An object whose value is the sum of the date and time represented by this instance and the number of hours represented by value.
Returns a new System.DateTime that adds the specified number of milliseconds to the value of this instance.
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.
An object whose value is the sum of the date and time represented by this instance and the number of milliseconds represented by value.
Returns a new System.DateTime that adds the specified number of minutes to the value of this instance.
A number of whole and fractional minutes. The value parameter can be negative or positive.
An object whose value is the sum of the date and time represented by this instance and the number of minutes represented by value.
Returns a new System.DateTime that adds the specified number of months to the value of this instance.
A number of months. The months parameter can be negative or positive.
An object whose value is the sum of the date and time represented by this instance and months.
Returns a new System.DateTime that adds the specified number of seconds to the value of this instance.
A number of whole and fractional seconds. The value parameter can be negative or positive.
An object whose value is the sum of the date and time represented by this instance and the number of seconds represented by value.
Returns a new System.DateTime that adds the specified number of ticks to the value of this instance.
A number of 100-nanosecond ticks. The value parameter can be positive or negative.
An object whose value is the sum of the date and time represented by this instance and the time represented by value.
Returns a new System.DateTime that adds the specified number of years to the value of this instance.
A number of years. The value parameter can be negative or positive.
An object whose value is the sum of the date and time represented by this instance and the number of years represented by value.
Indicates whether this instance of System.DateTime is within the daylight saving time range for the current time zone.
true if the value of the System.DateTime.Kind property is System.DateTimeKind.Local or System.DateTimeKind.Unspecified and the value of this instance of System.DateTime is within the daylight saving time range for the local time zone; false if System.DateTime.Kind is System.DateTimeKind.Utc.
Subtracts the specified date and time from this instance.
The date and time value to subtract.
A time interval that is equal to the date and time represented by this instance minus the date and time represented by value.
Subtracts the specified duration from this instance.
The time interval to subtract.
An object that is equal to the date and time represented by this instance minus the time interval represented by value.
Serializes the current System.DateTime object to a 64-bit binary value that subsequently can be used to recreate the System.DateTime object.
A 64-bit signed integer that encodes the System.DateTime.Kind and System.DateTime.Ticks properties.
Converts the value of the current System.DateTime object to local time.
An object whose System.DateTime.Kind property is System.DateTimeKind.Local, and whose value is the local time equivalent to the value of the current System.DateTime object, or System.DateTime.MaxValue if the converted value is too large to be represented by a System.DateTime object, or System.DateTime.MinValue if the converted value is too small to be represented as a System.DateTime object.
Converts the value of the current System.DateTime object to its equivalent long date string representation.
A string that contains the long date string representation of the current System.DateTime object.
Converts the value of the current System.DateTime object to its equivalent long time string representation.
A string that contains the long time string representation of the current System.DateTime object.
Converts the value of the current System.DateTime object to its equivalent short date string representation.
A string that contains the short date string representation of the current System.DateTime object.
Converts the value of the current System.DateTime object to its equivalent short time string representation.
A string that contains the short time string representation of the current System.DateTime object.
Converts the value of the current System.DateTime object to Coordinated Universal Time (UTC).
An object whose System.DateTime.Kind property is System.DateTimeKind.Utc, and whose value is the UTC equivalent to the value of the current System.DateTime object, or System.DateTime.MaxValue if the converted value is too large to be represented by a System.DateTime object, or System.DateTime.MinValue if the converted value is too small to be represented by a System.DateTime object.
Static
DaysStatic
EqualsDetermines whether the specified object instances are considered equal.
The first object to compare.
The second object to compare.
true if the objects are considered equal; otherwise, false. If both objA and objB are null, the method returns true.
Static
ParseConverts the string representation of a date and time to its System.DateTime equivalent by using the conventions of the current thread culture.
A string that contains a date and time to convert. See The string to parse for more information.
An object that is equivalent to the date and time contained in s.
Static
SpecifyCreates a new System.DateTime object that has the same number of ticks as the specified System.DateTime, but is designated as either local time, Coordinated Universal Time (UTC), or neither, as indicated by the specified System.DateTimeKind value.
A date and time.
One of the enumeration values that indicates whether the new object represents local time, UTC, or neither.
A new object that has the same number of ticks as the object represented by the value parameter and the System.DateTimeKind value specified by the kind parameter.
Static
TryConverts the specified string representation of a date and time to its System.DateTime equivalent and returns a value that indicates whether the conversion succeeded.
A string containing a date and time to convert.
When this method returns, contains the System.DateTime value equivalent to the date and time contained in s, if the conversion succeeded, or System.DateTime.MinValue if the conversion failed. The conversion fails if the s parameter is null, is an empty string (""), or does not contain a valid string representation of a date and time. This parameter is passed uninitialized.
true if the s parameter was converted successfully; otherwise, false.
Represents an instant in time, typically expressed as a date and time of day.