Search notes:
VBA: data type date
A
date literal allows to «hard code» a specific date/time unambigously, that is independent from the currently used
locale.
Similarly, timeSerial(hr, min, sec)
constructs a time.
The
functions now
returns the current date and time,
date
just returns the current date.
These functions add a given number of days to a date or return the number of days between two given days, respectively
Internally, a
date is stored as
double. the decimal places store the time fraction of a day and the non-decimal places the days since a given date.
The default value for a date is 1899-12-30 00:00:00.
Internal representation
The value 0.0
corresponds to midnight (start of) December 30th, 1899:
? format(cDate(0.0), "yyyy-mm-dd hh:nn:ss")
1899-12-30 00:00:00
? format(cDate(0.0 + 1.0/86400), "yyyy-mm-dd hh:nn:ss")
1899-12-30 00:00:01
? format(cDate(1.0), "yyyy-mm-dd hh:nn:ss")
1899-12-31 00:00:00