DateTime Data Type
Holds 64-bit (8-byte) date and time values in the range 1 January 0001 00:00:00–31 December 9999 23:59:59.
- Default value
- When you declare a variable of type
DateTimeand do not give it an initial value,, the value is
@0000-00-00@00:00:00, which is not a correct date, but not an error.
- Type characters
DateTimehas no type character.
@ year / month / day
@ hours : minutes : seconds
@ year / month / day @ hours : minutes : seconds
The above named parts of a date or time must be decimal digits. Some more rules follow.
- Divides the parts of a date.
Alternatives are hyphens (
-) and periods (
- You can specify a fraction of a second by placing a decimal point (
.) between two sets of digits. The fractional part is limited to seven digits. Digits after that are ignored.
Shared methods and properties
DateTime.Day As Int
- Returns the current day of the month.
DateTime.Default As DateTime
- Returns the default value,
DateTime.Hour As Int
- Returns the current hour.
DateTime.Local As DateTime
- Returns the local date and time of the system.
DateTime.Millisecond As Int
- Returns the current millisecond.
DateTime.Minute As Int
- Returns the current minute.
DateTime.Month As Int
- Returns the current month.
DateTime.Parse(str As String, Optional #fmt As Format) As DateTime
- Tries to parse a string that shows as a date or time.
#fmtis not given or is
#Null, then it uses the format of the local culture. Or you can be explicit with
DateTime.Second As Int
- Returns the current second.
DateTime.Size As Int
- Returns the number of available bytes. This is always 8.
DateTime.UTCLocal As DateTime
- Returns the current date and time in UTC.
DateTime.Year As Int
- Returns the current year.
ViviFire can change between the type
DateTime and other types.
Some changes can be in one direction only.
Changed to DateTime
|Integer types||If you add the integer |
Changed from DateTime
||The short date format specified by the user's locale and the time as a 12- or 24-hour format. If you try to change the default value to String, then the result is TBD.|
|floating-point types||A value of |
Dim foo As DateTime foo = @2013/12/11@10:09:08