Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

format issue

Status
Not open for further replies.

VICKEL1

Programmer
May 16, 2005
15
GB
I have a string "01/12/2006" and i need to format it to dd-mmm-yyyy (01-Dec-2006).
 
Here's an example that show the process step by step:
Code:
Dim str As String = "01/12/2006"
MsgBox(str)
Dim mo As String = str.Substring(3, 2) & "/" & str.Substring(0, 2) & "/" & str.Substring(6)
MsgBox(mo)
Dim dt As Date = Date.Parse(mo)
MsgBox(dt.ToShortDateString)
MsgBox(dt.ToString("dd-MMM-yyyy"))
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top