The Date Data Type
You learned in Chapter 12 that VBA uses the Date data type to store dates and times. The Date type is a floating-point data type. The integer part of the value represents the date as the number of days since December 30, 1899, with dates before then represented by negative values. The decimal part of the value represents the time as a fraction of the 24-hour day. Thus, .25 is 6A.M., .5 is noon, and so on. A date value with no integer part represents a time without a date.
The fact that 36495.4375 represents 10:30A.M. on December 1, 1999, may not seem particularly useful to you! Don't worry, because VBA makes it easy to display dates and times in the formats your are accustomed to. The advantage of representing dates and times ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access