Format datetime

J

JC Voon

hi:


Is there a function to format the datetime value to the following
format 2005-09-29T17:57:03.0000000+08:00 ?

currently i'm using a hard way


Dim result As String
Dim offset As Long

result =
Format(value,DateTimeFormatInfo.CurrentInfo.SortableDateTimePattern)

offset = TimeZone.CurrentTimeZone.GetUtcOffset(value).Ticks

result &= CStr(IIf(offset < 0, "-", "+")) & _
Format(New DateTime(offset), "hh:mm")

Thanks
JCVoon
 
J

jcvoon

Ken Tucker:

Thanks.

Now.ToString(DateTimeFormatInfo.CurrentInfo.SortableDateTimePattern &
"zzz")

JCVoon
 

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

Top