|
-
Jun 12th, 2003, 09:01 PM
#1
Thread Starter
New Member
Date format
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...
-
Jun 13th, 2003, 07:33 AM
#2
Sleep mode
Re: Date format
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 .
-
Jun 13th, 2003, 10:11 AM
#3
Lively Member
'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)
-
Jun 15th, 2003, 07:05 PM
#4
PowerPoster
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|