string ToString() | It returns the date & time value in the default date format, based on current Windows settings. |
string ToString(string format) | It returns the date & time value in the specified format. |
string ToShortDateString() | It returns the date value in the default short date format, based on current Windows settings. Eg: MM/dd/yyyy (12/31/2030) |
string ToLongDateString() | It returns the date value in the default long date format, based on current Windows settings. Eg: dd MMMM yyyy (31 December 2030) |
string ToShortTimeString() | It returns the date value in the default short time format, based on current Windows settings. Eg: hh:mm tt (11:59 PM) |
string ToLongTimeString() | It returns the date value in the default long time format, based on current Windows settings. Eg: hh:mm:ss tt (11:59:59 PM) |
static int DaysInMonth(int year, int month) | It returns the number of days in the specified month in the specified year. |
int CompareTo(DateTime value) | It compares this instance to another date. Returns -1 if earlier, 0 if equal, and 1 if later. |
TimeSpan Subtract(DateTime value) | It returns an instance of TimeSpan structure representing the date difference between the current instance and the given date value. |
DateTime AddDays(double value) | It creates and returns a new instance of DateTime structure after adding specified days (+ve or -ve) to the current date & time value. |
DateTime AddMonths(double value) | It creates and returns a new instance of DateTime structure after adding specified months (+ve or -ve) to the current date & time value. |
DateTime AddYears(double value) | It creates and returns a new instance of DateTime structure after adding specified years (+ve or -ve) to the current date & time value. |
DateTime AddHours(double value) | It creates and returns a new instance of DateTime structure after adding specified hours (+ve or -ve) to the current date & time value. |
DateTime AddMinutes(double value) | It creates and returns a new instance of DateTime structure after adding specified minutes (+ve or -ve) to the current date & time value. |
DateTime AddSeconds(double value) | It creates and returns a new instance of DateTime structure after adding specified seconds (+ve or -ve) to the current date & time value. |
DateTime AddMilliseconds(double value) | It creates and returns a new instance of DateTime structure after adding specified milliseconds (+ve or -ve) to the current date & time value. |