## Date Time To Double FunctionDates Times Class

```Public Function DateTimeToDouble( _
ByVal vDateTime As Variant _
) As Variant```

### Takes a Date/time value an converts it into the floating-point number of days since 12/30/1899 00:00. This is different that using the CDbl function to convert a Date to a Double because of the way that Microsoft represents pre-1900 dates. Inverse of the DoubleToDateTime function.

Summary: Microsoft represents the date component of Date values as the integer number of days since 12/30/1899, and they represent the time component of Date values as the fractional part of the day since midnight on the Date. This is different than representing Date values as the floating-point number of days since 12/30/1899 because the day 12/30/1899 has two representations within the Microsoft scheme (-1 < Value <= 0 and 0 <= Value < 1). This causes problems if you do date arithmetic on pre-12/30/1899 dates. Sorting Date/time values whose dates are prior to 12/30/1899 will cause the values to be sorted incorrectly because of Microsoft's representation.
Examples:
```    CDbl(#12/29/1899 00:00#) = -1
CDbl(#12/29/1899 06:00#) = -1.25 ' Note
CDbl(#12/29/1899 18:00#) = -1.75 ' Note
CDbl(#12/30/1899 00:00#) =  0
CDbl(#12/30/1899 06:00#) =  0.25
CDbl(#12/30/1899 18:00#) =  0.75
CDbl(#12/31/1899 00:00#) =  1
DateTimeToDouble(#12/29/1899 00:00#) = -1
DateTimeToDouble(#12/29/1899 06:00#) = -0.75
DateTimeToDouble(#12/29/1899 18:00#) = -0.25
DateTimeToDouble(#12/30/1899 00:00#) =  0
DateTimeToDouble(#12/30/1899 06:00#) =  0.25
DateTimeToDouble(#12/30/1899 18:00#) =  0.75
DateTimeToDouble(#12/31/1899 00:00#) =  1```
`    DoubleToDateTime Function`