Date & Time format

  • Thread starter Thread starter Bill Nguyen
  • Start date Start date
B

Bill Nguyen

I receive data in an XML file with the following date/time format. While I
can parse the date & time using string function, I would like to know if
this is some sort of datetime in SQLserver that I can use directly:

<DateTime>2006-03-29T13:12:00.000</DateTime>

Thanks

Bill
 
Why would you be using a string function to parse a date & time that is in
this format?

The format is the conforms to the ISO 8601 standard and is handled via the
Standard DateTime Format string s.

Therefore:

Dim _d as DateTime

DateTime.ParseExact(node.InnerText, "s", Nothing,
DateTimeStyles.AssumeLocal)

Modify the last 2 parameters to the ParesExact method as required.
 
Thanks Stephany.

Bill
Stephany Young said:
Why would you be using a string function to parse a date & time that is in
this format?

The format is the conforms to the ISO 8601 standard and is handled via the
Standard DateTime Format string s.

Therefore:

Dim _d as DateTime

DateTime.ParseExact(node.InnerText, "s", Nothing,
DateTimeStyles.AssumeLocal)

Modify the last 2 parameters to the ParesExact method as required.
 
Back
Top