In vb as mentioned a date is stored as a floating point with a integer part representing how many days have elapsed since the base date of 12/30/1899. The decimal part is fraction of time since midnight. Every time you look at a date it has a format applied if not your date of
"6/13/2009 23:56:04"
would appear as 39977.9972685185
which is 39,977 days since 12/30/1899
and .9972685185 of a day or (23 hrs, 56 min and 4 sec)
So if you enter into a date field just 6/13/2009 it is stored as the value 39977.0
or if you enter the value 23:56:04 it is stored as 0.9972685185.
So here is a test
[/code]
Public Sub test4()
Dim strDate As String
Dim dtm As Date
Dim dblDate As Double
strDate = "6/13/2009 23:56:04"
dtm = CDate(strDate)
dblDate = dtm
Debug.Print dblDate
Debug.Print Format(dtm, "mm/dd/yyyy")
Debug.Print Format(dtm, "hh:nn:ss")
Debug.Print Format(dtm, "mmmm, dd, yyyy")
Debug.Print Format(dtm, "q\Quarter yy")
End Sub
[/code]
and your output
39977.9972685185
06/13/2009
23:56:04
June, 13, 2009
2Quarter 09
Which shows how your date is actually stored, and that you can format it almost any way you want for display purposes.