Represents a date and time value.
[Visual Basic] Public Structure DateTime Implements IComparable, IFormattable, IConvertible [C#] public struct DateTime : IComparable, IFormattable, IConvertible [C++] public __value struct DateTime : public IComparable, IFormattable, IConvertible
[JScript] In JScript, you can use the structures in the NGWS frameworks, but you cannot define your own.
A DateTime object has a property named Ticks that stores the date and time as the number of 100-nanosecond intervals since 12:00 AM January 1, 1 A.D (year) in the GregorianCalendar.
For example, a ticks value of 31241376000000000L has the string representation "Friday, January 01, 0100 12:00:00 AM". Each additional tick increases the time interval by 100-nanoseconds.
The default string format options that may be used in Format are as follows:
d | Short Date |
---|---|
D | Long Date |
f | Full (long date + short time) |
F | Full (long date + long time) |
g | General (short date + short time) |
G | General (short date + long time) |
m, M | Month/Day Date |
r, R | RFC Standard |
s | Sortable without TimeZone info |
t | Short Time |
T | Long Time |
u | Universal with sort able format |
U | Universal with Full (long date + long time) format |
y, Y | Year/Month Date |
Note Some systems will not be able to get dates for 2-digit years of less than 1930. This is because OLE Automation string parsing routines look for at your computer's default short date string format, which uses 2-digit years on most computers. To fix this, go to Control Panel, Regional Settings, then Date and change the short date type to specify a 4-digits year ("m/d/yyyy").
Namespace: System
Assembly: mscorlib.dll
DateTime Members | System Namespace | IComparable | IFormattable | IConvertible | Calendar | GregorianCalendar | JulianCalendar | ization[cref.Globalization | CultureInfo | DateTimeFormatInfo | TimeSpan