Date format question

  • Thread starter Thread starter Mike R
  • Start date Start date
M

Mike R

Hi

I have a web service that requires an xml tag to be formatted like this :

<StartDate>2004-01-13T00:00:00.0000000-00:00</StartDate>

Using vb.net how do I get this format. I've tried the various functions to
no avail.

Thanks

Mike
 
What are the actual field components supposed to be? It's appears to be
self explanitory until you get to the fractions of a second.

Mike.
 
Michael D. Ober said:
What are the actual field components supposed to be? It's appears to be
self explanitory until you get to the fractions of a second.

Mike.

Thanks Mike, Yes, I think I may have worked it out _ was looking too hard

Dim d As Date

Dim ts As System.TimeSpan

ts = System.TimeZone.CurrentTimeZone.GetUtcOffset(Now())

'MsgBox(ts.ToString)

MsgBox(Now.Year & "-" & Now.Month.ToString("xx") & "-" & Now.Day & "T" &
Now.ToShortTimeString & ":00.0000000" & ts.ToString)

'MsgBox(Now.Date)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top