tags:

views:

103

answers:

2

Hello,

From my VB application I am generating XML document based on data fetched from Oracle db.

I have a XML schema element of type dateTime

When I try to validate I am getting the following error

cvc-datatype-valid.1.2.1: '8/20/2009 1:30:00 PM' is not a valid value for 'dateTime'

How do I handle this in my vb.net application. How can I convert the oracle datetime into xml specific dateTime.

Thanks

A: 

The format needs to be YYYY-MM-DDTHH:MM:SS, commonly known as the ISO format (and yes, that's a literal 'T' between the day and hour portion). The year needs to come first, then the two-digit month, then the two-digit day, and similarly, hours, minutes and seconds all need to be in two-digit format. Also, the hours need to be in 24-hour format, not AM/PM.

How are you generating your XML from the Oracle data?

lavinio
A: 

Got it System.DateTime in my aspx.

Now, DateTime.Now.ToString("s") translates correctly into sortable ISO format 'yyyy-MM-ddTHH:mm:ss'.