How to enter datetime in Excel Data Source

paolabspaolabs Posts: 16

I am using an excel data source to import data to generate complex structures, I have managed to work with creating relationships between the different sheets, but the one thing that I can't figure out how to do is how to enter dates so that I don't get an invalid datetime error.

Anyone has done this and knows the correct format?


  • benken_parasoftbenken_parasoft Posts: 1,011 ✭✭✭

    Can you please be specific about what error you are seeing? What is the message, exactly? Do you see it when configuring the data source or when running your test suite? Do you see the error in the Console view or the Quality Tasks view? If in the Quality Tasks view, is there detail if you double click the error? Is the error reported from a particular test? If so, how is that test configured to use the data source?

  • paolabspaolabs Posts: 16

    I see the error in the Quality Tasks view. When I click on it, this is the detail that I see, and I get something similar wherever I have dates.

    Not sure what you mean about how the test is configured to use the data source

    Error Message:
    DataSource: HotelDS (row 1): Value "1/1/17" from the "Taxes:Start" column is not a valid dateTime.

    Additional Details:
    Source: HotelDS (row 1)

  • Thomas MooreThomas Moore Posts: 82 admin

    Hi paolabs,

    It sounds to me like your dateTime format does not adhere to the expected structure. Are you using a WSDL to set your schema? If so, I would use one of the dateTime formats here.


    Hope this helps!

  • benken_parasoftbenken_parasoft Posts: 1,011 ✭✭✭

    Not sure what you mean about how the test is configured to use the data source

    Based on the error message you provided, you must be configuring a dateTime field in the Form Input view against the "Taxes:Start" column. "1/1/17" is not in the correct format for dateTime as defined by XML Schema specifications. It must include both a date and a time component and be formatted correctly. From :

    dateTime consists of finite-length sequences of characters of the form: '-'? yyyy '-' mm '-' dd 'T' hh ':' mm ':' ss ('.' s+)? (zzzzzz)

  • paolabspaolabs Posts: 16

    Yes, I was initially entering the date as YYYY-MM-DD but that was not enough, I had to enter this as an example for it to work: 2018-08-16T17:37:09.911Z

Sign In or Register to comment.