Format datetime

  • Thread starter Thread starter JC Voon
  • Start date Start date
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
 
Ken Tucker:

Thanks.

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

JCVoon
 
Back
Top