Public Function DateTimeToDouble( _
ByVal vDateTime As Variant _
) As Variant 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#) = 1See also: DoubleToDateTime FunctionvDate: The date whose time component is corrested if the date is prior to 12/30/1899. vDate is assumed to be a Date in Microsoft's representation. The return value is the floating-point number of days since 12/30/1899. Function returns Null if vDate is Null or cannot be fixed up to a Date.
Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.