Hi,
I have this code
VB Code:
Dim timenow as String = System.DateTime.now
this return somethign like this
How do i remove those "-", ":" and the space between 2004 and 22?Code:8-12-2004 22:18:05
thanks
Printable View
Hi,
I have this code
VB Code:
Dim timenow as String = System.DateTime.now
this return somethign like this
How do i remove those "-", ":" and the space between 2004 and 22?Code:8-12-2004 22:18:05
thanks
You can get the date, year, month, time etc. all by themselves. Try this:
System.DateTime.Now.Year, System.DateTime.Now.Month, System.DateTime.Now.Day etc. :)
you can chain the replace function together (great little feature of the .net objects)
Code:Dim str As String = Now.ToString
str = str.Replace(":", "").Replace(" ", "").Replace("-", "")
MsgBox(str)