static DateTime min;
- Represents the smallest possible DateTime value.
static DateTime max;
- Represents the largest possible DateTime value.
static DateTime opCall(long ticks, DateTimeKind kind = cast(DateTimeKind)0);
- Initializes a new instance.
static DateTime opCall(int year, int month, int day, DateTimeKind kind = cast(DateTimeKind)0);
- Initializes a new instance.
static DateTime opCall(int year, int month, int day, int hour, int minute, int second, DateTimeKind kind = cast(DateTimeKind)0);
- Initializes a new instance.
static DateTime opCall(int year, int month, int day, int hour, int minute, int second, int millisecond, DateTimeKind kind = cast(DateTimeKind)0);
- Initializes a new instance.
DateTime add(TimeSpan value);
DateTime opAdd(TimeSpan value);
void opAddAssign(TimeSpan value);
- Adds the specified TimeSpan to the value of this instance.
DateTime subtract(TimeSpan value);
DateTime opSub(TimeSpan value);
void opSubAssign(TimeSpan value);
- Subtracts the specified number of ticks from the value of this instance.
DateTime addTicks(long value);
- Adds the specified number of ticks to the value of this instance.
DateTime addMilliseconds(double value);
- Adds the specfied number of milliseconds to the value of this instance.
Parameters
double value
A number of whole a fractional milliseconds.
DateTime addSeconds(double value);
- Adds the specfied number of seconds to the value of this instance.
Parameters
double value
A number of whole a fractional seconds.
DateTime addMinutes(double value);
- Adds the specfied number of minutes to the value of this instance.
Parameters
double value
A number of whole a fractional minutes.
DateTime addHours(double value);
- Adds the specfied number of hours to the value of this instance.
Parameters
double value
A number of whole a fractional hours.
DateTime addDays(double value);
- Adds the specfied number of days to the value of this instance.
Parameters
double value
A number of whole a fractional days.
DateTime addMonths(int value);
- Adds the specified number of months to the value of this instance.
Parameters
int value
A number of months.
DateTime addYears(int value);
- Adds the specified number of years to the value of this instance.
Parameters
int value
A number of years.
static DateTime parse(char[] s, IFormatProvider provider = cast(IFormatProvider)null);
- Converts the specified string representation of a date and time to its DateTime equivalent.
Parameters
char[] s
A string containing a date and time to convert.
IFormatProvider provider
An object that supplies culture-specific information about s.
static DateTime parseExact(char[] s, char[] format, IFormatProvider provider = cast(IFormatProvider)null);
- Converts the specified string representation of a date and time to its DateTime equivalent.
Parameters
char[] s
A string containing a date and time to convert.
char[] format
A format specifier that defines the required format of s.
IFormatProvider provider
An object that supplies culture-specific information about s.
static DateTime parseExact(char[] s, char[][] formats, IFormatProvider provider = cast(IFormatProvider)null);
- Converts the specified string representation of a date and time to its DateTime equivalent.
Parameters
char[] s
A string containing a date and time to convert.
char[][] formats
An array of allowable formats of s.
IFormatProvider provider
An object that supplies culture-specific information about s.
static bool tryParse(char[] s, out DateTime result);
- Converts the specified string representation of a date and time to its DateTime equivalent.
Parameters
char[] s
A string containing a date and time to convert.
DateTime result
The DateTime equivalent to the date and time specified in s.
static bool tryParse(char[] s, IFormatProvider provider, out DateTime result);
- Converts the specified string representation of a date and time to its DateTime equivalent.
Parameters
char[] s
A string containing a date and time to convert.
IFormatProvider provider
An object that supplies culture-specific formatting information.
DateTime result
The DateTime equivalent to the date and time specified in s.
static bool tryParseExact(char[] s, char[] format, IFormatProvider provider, out DateTime result);
- Converts the specified string representation of a date and time to its DateTime equivalent.
Parameters
char[] s
A string containing a date and time to convert.
char[] format
A format specifier that defines the required format of s.
IFormatProvider provider
An object that supplies culture-specific formatting information.
DateTime result
The DateTime equivalent to the date and time specified in s.
static bool tryParseExact(char[] s, char[][] formats, IFormatProvider provider, out DateTime result);
- Converts the specified string representation of a date and time to its DateTime equivalent.
Parameters
char[] s
A string containing a date and time to convert.
char[][] formats
An array of allowable formats of s.
IFormatProvider provider
An object that supplies culture-specific formatting information.
DateTime result
The DateTime equivalent to the date and time specified in s.
char[] toString(char[] format, IFormatProvider provider);
char[] toString(char[] format);
char[] toString();
- Converts the value of this instance to its equivalent string representation.
Parameters
char[] format
A DateTime format string.
IFormatProvider provider
An object that supplies culture-specific formatting information.
char[] toShortDateString();
char[] toLongDateString();
char[] toShortTimeString();
char[] toLongTimeString();
static int compare(DateTime d1, DateTime d2);
- Compares two DateTime instances and returns in integer that determines whether the first
is earlier than, the same as, or later than the second.
Parameters
DateTime d1
The first instance.
DateTime d2
The second instance.
int compareTo(DateTime other);
int opCmp(DateTime other);
- Compares the value of this instance to a specified DateTime value and indicates whether this
instance is earlier than, the same as, or later than the specified DateTime value.
Parameters
DateTime other
The instance to compare.
bool equals(DateTime other);
bool opEquals(DateTime other);
- Indicates whether this instance is equal to the specified DateTime instance.
Parameters
DateTime other
The instance to compare to this instance.
DateTime toLocal();
DateTime toUtc();
int hour();
- Gets the hour component.
int minute();
- Gets the minute component.
int second();
- Gets the seconds component.
int millisecond();
- Gets the milliseconds component.
int day();
- Gets the day of the month.
DayOfWeek dayOfWeek();
- Gets the day of the week.
int dayOfYear();
- Gets the day of the year.
int month();
- Gets the month component.
int year();
- Gets the year component.
DateTime date();
- Gets the date component.
long ticks();
- Gets the number of ticks that represent the date and time.
static int daysInMonth(int year, int month);
- Gets the number of days in the specified month and year.
Parameters
int year
The year.
int month
The month.
static bool isLeapYear(int year);
- Indicates whether the specified year is a leap year.
static DateTime now();
- Gets a DateTime that is set to the current date and time, expressed as the local time.
static DateTime utcNow();
- Gets a DateTime that is set to the current date and time, expressed as the Coordinated Universal Time (UTC).
static DateTime fromFileTime(long fileTime);
- Converts the specified Windows file time to an equivalent local time.
Parameters
long fileTime
A Windows file time expressed in ticks.
static DateTime fromFileTimeUtc(long fileTime);
- Converts the specified Windows file time to an equivalent UTC time.
Parameters
long fileTime
A Windows file time expressed in ticks.
long toFileTime();
long toFileTimeUtc();
static DateTime fromOleDate(double d);
- Converts an OLE Automation date to a DateTime.
Parameters
double d
An OLE Automation date.
double toOleDate();
- Converts the value of this instance to an OLE Automation date.