Rob,
In addition to the other comments:
| date....so it's truncating my fractions of a second!!!
Are you certain that it is truncating them as opposed to simply not showing
them?
See the remarks at:
http://msdn.microsoft.com/library/d.../cpref/html/frlrfsystemdatetimeclasstopic.asp
<quote>
DateTime values are measured in 100-nanosecond units called ticks, and a
particular date is the number of ticks since 12:00 midnight, January 1, 1,
A.D. (C.E.)
</quote>
100-nanosecond units should be more then enough to cover 1000th of a second!
Remember that a nanosecond is one billionth (10 to -9th) of a second.
DateTime values by default are only displayed to seconds, however this is
normally only a Display Issue! If you want the to see the 100-nanosecond
units, you need to use a custom DateTime format.
http://msdn.microsoft.com/library/d...ide/html/cpconcustomdatetimeformatstrings.asp
For example:
Dim aDate As DateTime = DirectCast(theDataView!theDateColumn,
DateTime)
Debug.WriteLine(aDate.ToString(), "default formatting")
Debug.WriteLine(aDate.ToString("yyyy.MM.dd hh:mm:ss.fffffff"),
"custom formatting")
The ".fffffff" says to display seconds fractions to the full seven digits
(100-nanoseconds), try the above two lines with the Date column in your
DataView. Try the above two lines with DateTime.Now
Dim aDate As DateTime = DateTime.Now
Debug.WriteLine(aDate.ToString(), "default formatting")
Debug.WriteLine(aDate.ToString("yyyy.MM.dd hh:mm:ss.fffffff"),
"custom formatting")
I suspect your fractions of seconds are not being truncated, rather they are
simply not being displayed!
Depending on how you are displaying the date you need to include a "format"
that includes fractions of seconds. For example with the Windows Forms
DataGrid, you can add a TableStyle for your table, then add a
DataGridTextBoxColumn for your date column. You can then set
DataGridTextBoxColumn.Format to a custom format that includes the fractions
of seconds you want displayed...
Hope this helps
Jay
| I'm storing a date/time into a SQL table of type datetime. I need it to
be
| precise so the value is stored to the 1000th of a second. ie "insert
into
| myTable mydate values ('08/05/2005 2:56:11.987'). This works fine...if
you
| check the value in the table with query analyzer, it shows in there
| properly.
|
| Now, in my app, I'm executing the same query (that I used in QA) and
storing
| tha in a dataview. If I break and watch the program, the value that's
| stored in the dataview is #8/5/2005 2:56:11 PM# with a datatype of
| date....so it's truncating my fractions of a second!!!
|
| How can I get my missing time? Thanks.
|
|