Store Reader DateTime Parsing w/ milliseconds

  1. #1

    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:
    <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" />
  2. #2

    RE: Store Reader DateTime Parsing w/ milliseconds

    *In case anyone is interested, I figured this one out.
    <ext:RecordField Name="DateCreated" Type="Date" DateFormat="yyyy-MM-ddThh:mm:ss.uP" />

    I think it's abusing something in the .NET->PHP/Javascript date format converter, as "u" isn't valid according to the reference for .NET date specifiers, but it appears it passes through the conversion unscathed to the javascript extjs code:
    {dateFormat:"Y-m-dTh:i:s.uP",type:"date",name:"DateCreated"}

    which thankfully supports milliseconds.


    OK, no idea why the code blocks aren't working properly, but you get the idea.
  3. #3
    I use DateFormat="c"

Similar Threads

  1. Sugestion about Ext.net.Store and ur Reader
    By marcelorosait in forum 1.x Help
    Replies: 0
    Last Post: Feb 17, 2012, 6:54 PM
  2. [CLOSED] Reader id issue in Store
    By speedstepmem4 in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Jan 20, 2011, 12:04 PM
  3. [CLOSED] [1.0] Json Webservice DateTime Parsing Error
    By webclouder in forum 1.x Legacy Premium Help
    Replies: 7
    Last Post: Jun 04, 2010, 1:10 AM
  4. Store.Reader.Count = 1?
    By jsemple in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Apr 23, 2010, 8:05 PM
  5. Serialize needed by Reader of Store only
    By izee in forum 1.x Help
    Replies: 0
    Last Post: May 21, 2009, 2:00 PM

Posting Permissions