What Is a Date, and How Did It Get There?

Started by sukishan, Sep 04, 2009, 04:34 PM

Previous topic - Next topic

sukishan

What Is a Date, and How Did It Get There?
All other definitions aside, to VBA, a date is an 8-byte floating-point value that can contain information indicating a specific point in time. In particular, the integer portion of the value contains a number of days since December 30, 1899. The fractional portion of the date value represents the portion of the day stored in the value.

For example, if the current date is 5/22/97 at 3:00 p.m., VBA stores the value internally as 35572.625. That is, the current date is 35572 days after 12/30/1899, and 3:00 p.m. is 625/1000 of a full day. In general, you don't have to care about the storage mechanism; VBA handles the conversions gracefully to and from the internal floating-point format and the external date display.
A good beginning makes a good ending