By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,534 Members | 943 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,534 IT Pros & Developers. It's quick & easy.

Date format question

P: n/a
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
Nov 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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.

"Mike R" <Mi**@mikeread.freeserve.co.uk> wrote in message
news:cd*******************@news.demon.co.uk...
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

Nov 20 '05 #2

P: n/a
I believe you will have to play with your date a little. Here's a link on
Date Time formatting that explains what you can do:
http://msdn.microsoft.com/netframewo...eAndTimeFAQ.as
px

Also, you will want to use System.TimeZone.CurrentTimeZone.GetUtcOffset to
get the last portion of your date.

I hope this helps a little.

Telmo Sampaio
System.TimeZone.CurrentTimeZone.GetUtcOffset

"Mike R" <Mi**@mikeread.freeserve.co.uk> wrote in message
news:cd*******************@news.demon.co.uk...
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

Nov 20 '05 #3

P: n/a

"Michael D. Ober" <mdo.@.wakeassoc..com> wrote in message
news:um**************@TK2MSFTNGP10.phx.gbl...
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.

"Mike R" <Mi**@mikeread.freeserve.co.uk> wrote in message
news:cd*******************@news.demon.co.uk...
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



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)
Nov 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.