S simon Jun 11, 2004 #1 I have date="11.6.2004"(today) and I would like to format it as: 20040611 How can I do that? Thank you, Simon
I have date="11.6.2004"(today) and I would like to format it as: 20040611 How can I do that? Thank you, Simon
A Armin Zingler Jun 11, 2004 #2 simon said: I have date="11.6.2004"(today) and I would like to format it as: 20040611 How can I do that? Click to expand... Dim d As Date Dim s As String() s = "11.6.2004".Split("."c) d = New Date(CInt(s(2)), CInt(s(1)), CInt(s(0))) MsgBox(d.ToString("yyyyMMdd")) -- Armin How to quote and why: http://www.plig.net/nnq/nquote.html http://www.netmeister.org/news/learn2quote.html
simon said: I have date="11.6.2004"(today) and I would like to format it as: 20040611 How can I do that? Click to expand... Dim d As Date Dim s As String() s = "11.6.2004".Split("."c) d = New Date(CInt(s(2)), CInt(s(1)), CInt(s(0))) MsgBox(d.ToString("yyyyMMdd")) -- Armin How to quote and why: http://www.plig.net/nnq/nquote.html http://www.netmeister.org/news/learn2quote.html
L Lars Netzel Jun 11, 2004 #3 You can always Use DatePart and build your own string but extracting Year, and Month and Day separate Dim MyNewDate as String = DatePart(DateInterval.Year, MyDate) & DatePart(DateInterval.Month, MyDate) & DatePart(DateInterval.Day, MyDate) /Lars Netzel
You can always Use DatePart and build your own string but extracting Year, and Month and Day separate Dim MyNewDate as String = DatePart(DateInterval.Year, MyDate) & DatePart(DateInterval.Month, MyDate) & DatePart(DateInterval.Day, MyDate) /Lars Netzel