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 ...

Get Office® XP Development with VBA now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.