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

Format datetime

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

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

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

Thanks
JCVoon
Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hi,

Take a look at the zzz format

http://msdn.microsoft.com/library/de...classtopic.asp

Ken
----------------------
"JC Voon" <jc*******@yahoo.com> wrote in message
news:43***************@msnews.microsoft.com...
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.Sortab leDateTimePattern)

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

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

Thanks
JCVoon

Nov 21 '05 #2

P: n/a
Ken Tucker:

Thanks.

Now.ToString(DateTimeFormatInfo.CurrentInfo.Sortab leDateTimePattern &
"zzz")

JCVoon

Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.