|
-
Feb 15th, 2001, 11:28 AM
#1
Thread Starter
New Member
Hello Everybody,
I am new to VB. I wanted to know how to get the day & month name using system date. Eg: 04/15/2001 it should show as April 04, Wednesday 15, Year 2001.
Please help me.
thankyou for everything.
Raghu
-
Feb 15th, 2001, 11:34 AM
#2
Fanatic Member
You can get everything except "Year", with this.
Code:
Private Sub Command1_Click()
Dim x As String
x = "04/15/2001"
MsgBox Format(x, "mmmm mm,dddd dd, yyyy")
End Sub
Might try using 2 format functions to concatenate "Year" into the string.
-
Feb 15th, 2001, 11:35 AM
#3
transcendental analytic
Code:
dim dt as date
dt="04/15/2001"
msgbox monthname(month(dt))
msgbox weekdayname(weekday(dt))
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Feb 15th, 2001, 11:36 AM
#4
Fanatic Member
Like this
Code:
Private Sub Command1_Click()
Dim x As String
x = "04/15/2001"
MsgBox Format(x, "mmmm mm,dddd dd") & " ,Year " & Format(x, "yyyy")
End Sub
-
Feb 15th, 2001, 11:41 AM
#5
That is certainly a strange way to display a date, but this will do it.
Code:
MsgBox Format(Now, "mmmm") & " " _
& Format(Now, "mm") & ", " _
& Format(Now, "dddd") & " " _
& Format(Now, "dd") & ", Year " _
& Format(Now, "yyyy")
-
Feb 15th, 2001, 11:50 AM
#6
Addicted Member
look at all them posts!! lol
hmm im feeling left out, so im going to make yet another variation of it... 
-------------------
Private Sub Command1_Click()
Dim DayName As String
DayName = "04/15/2001"
MsgBox Format(DayName, "dddd")
End Sub
-------------------
their... because he said he only wanted the name of the day :P
(dont mind me, im just bored)
-
Feb 15th, 2001, 11:51 AM
#7
Addicted Member
oh.. that last post wasent very dynamic..... here..
-------------------
Private Sub Command1_Click()
Dim DayName As String
DayName = Date
MsgBox Format(DayName, "dddd")
End Sub
-------------------
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
|