Results 1 to 4 of 4

Thread: format of Date()

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2000
    Location
    Hong Kong
    Posts
    62

    Question

    Hi I used the following code to change the system date to a string like "000923" for 23rd,sept 2000, however when I try this code on another computer gives me "002309". What's the cause of it? How can I modify my code to adapt different types of system date? Thanks!

    Code:
    strDate = Right(Date, 2) & IIf( _
            Len(Mid(Date, InStr(1, Date, "/") + 1, InStrRev(Date, "/") - InStr(1, Date, "/") - 1)) = 1, "0" & _
                Mid(Date, InStr(1, Date, "/") + 1, InStrRev(Date, "/") - InStr(1, Date, "/") - 1), Mid( _
                Date, InStr(1, Date, "/") + 1, InStrRev(Date, "/") - InStr(1, Date, "/") - 1)) & Left( _
            Date, 2)
    Please Visit My WebCam!!
    http://www.hmcheung.com

  2. #2
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    Private Sub Command1_Click()
    Dim x
    x = Format(Date, "yymmdd")
    MsgBox x

    End Sub
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  3. #3
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    hmcheung

    Tell the lady behind you to turn around and wave. She's on the TUBE !!!
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

  4. #4

    Thread Starter
    Member
    Join Date
    Jun 2000
    Location
    Hong Kong
    Posts
    62

    Talking

    Thanks HeSaidJoe, it solves my problem.
    James Stanich, the lady behind me is complaining that she is being captured by my webcam. :P
    Please Visit My WebCam!!
    http://www.hmcheung.com

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