Does anyone knoes how to changed the format of the date.
for example by default the date is 9/7/03..is there anyway to changed it to 9th july 2003????? all help are apreciated...:rolleyes:
Printable View
Does anyone knoes how to changed the format of the date.
for example by default the date is 9/7/03..is there anyway to changed it to 9th july 2003????? all help are apreciated...:rolleyes:
One way of changing date format is like this :
VB Code:
TextBox5.Text() = Format(Now.Today(), "")
or
VB Code:
MessageBox.Show(Format(Now.Today(), "dddd, MMM yyyy"))
the other way , you can use datetime picker .
'Will this work for you?
Const ST As String = "st"
Const ND As String = "nd"
Const RD As String = "rd"
Const TH As String = "th"
Dim CurrentDay As String = Format$(Now(), "dd")
Dim CurrentMonth As String = Format$(Now(), "MMMM")
Dim CurrentYear As String = Format$(Now(), "yyyy")
Select Case CurrentDay
Case "01", "21", "31"
CurrentDay += ST
Case "02", "22"
CurrentDay += ND
Case "03", "23"
CurrentDay += RD
Case Else
CurrentDay += TH
End Select
MsgBox(CurrentDay & " " & CurrentMonth & " " & CurrentYear)
OR
Dim myDate AS System.DateTime = New System.DateTime.Now()
MessageBox.Show(myDate.ToString("d/m/yy")
I didn't test it, but it will be similar to it. The ToString method is overloaded and you can supply a formatting string to get the desired results.