Results 1 to 3 of 3

Thread: asap please help very easy

  1. #1

    Thread Starter
    Hyperactive Member PITBULLCJR's Avatar
    Join Date
    Nov 1999
    Location
    New York
    Posts
    408

    Post

    I am stupid and I don't know how to make a variable say the date and time. Like say it is 1/1/00 7:14 pm thats what i want my variable to say. but i don't know how. I want it also to be the time as of right now. thanks

    ------------------
    Sincerely,
    Chris
    :-) ;-)
    Email [email protected]

  2. #2
    Addicted Member
    Join Date
    Jan 1999
    Posts
    239

    Post

    Put a Command Button on a Form and place the following in it's click event:

    [code]Private Sub Command1_Click()
    Dim MyDate As String
    Dim MyStr As String
    Dim MyTime As String

    MyDate = Date ' Assign Today's date to a String

    MyStr = Format(MyDate, " dddd, mmmm d, yyyy")
    ' Returns "Todays date as day of the week and
    ' Month of the year
    ' e.g. Wednesday Feb 4, 1997
    ' this is a VB internal function - see VB Help
    ' under Display Date

    MyTime = Time 'Assign the current time.
    'Time instead of Time$
    'formats the AM or PM
    'automatically

    Print MyStr, MyTime

    End Sub
    [//code]


  3. #3
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Post

    Format(Now(), "general date")

    ------------------
    Marty

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