Results 1 to 7 of 7

Thread: Day Name

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2001
    Posts
    6

    Exclamation

    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

  2. #2
    Fanatic Member
    Join Date
    Aug 2000
    Posts
    736
    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.

  3. #3
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    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.

  4. #4
    Fanatic Member
    Join Date
    Aug 2000
    Posts
    736
    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

  5. #5
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431
    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")

  6. #6
    Addicted Member
    Join Date
    Feb 2001
    Location
    Classified
    Posts
    234
    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)
    My ICQ Status: (85634850)

    Seriously Sick Tshirts

  7. #7
    Addicted Member
    Join Date
    Feb 2001
    Location
    Classified
    Posts
    234
    oh.. that last post wasent very dynamic..... here..

    -------------------
    Private Sub Command1_Click()
    Dim DayName As String
    DayName = Date
    MsgBox Format(DayName, "dddd")
    End Sub
    -------------------
    My ICQ Status: (85634850)

    Seriously Sick Tshirts

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width