Mar 01, 2009, 4:26 PM
Store Reader DateTime Parsing w/ milliseconds
I'm using a web service to retrieve information from my SQL Server database. The column is a standard datetime datatype, with a default value of getdate(). As such, it retains millisecond precision on the moment it was added.
This has caused problems with the field mapping into my Store.
Here's a sample of one of the XML tags containing a date directly from the database:
I've encountered this problem before, but because of the way I was pulling that data, I could override the select and edit the datatime to set milliseconds to 0 (which allows it to work). In this instance, I do not have direct access to the SQL command pulling the data, so I can't strip out the milliseconds in the select.
I've tried looking through all the documentation for a way to override the date format specifier, but as far as I can tell, there is no .NET format specifier for milliseconds. Is there any way to override this RecordField so that it will read the date?
Currently I just have a standard date RecordField:
This has caused problems with the field mapping into my Store.
Here's a sample of one of the XML tags containing a date directly from the database:
<DateCreated>2009-03-01T12:41:10.043-07:00</DateCreated>
The offending information here is the ".043" representing the milliseconds.I've encountered this problem before, but because of the way I was pulling that data, I could override the select and edit the datatime to set milliseconds to 0 (which allows it to work). In this instance, I do not have direct access to the SQL command pulling the data, so I can't strip out the milliseconds in the select.
I've tried looking through all the documentation for a way to override the date format specifier, but as far as I can tell, there is no .NET format specifier for milliseconds. Is there any way to override this RecordField so that it will read the date?
Currently I just have a standard date RecordField:
<ext:RecordField Name="DateCreated" Type="Date" />