SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Apr 2005
    Posts
    45
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Arrow converting using formatdatetime()

    hello friends

    can anybody please tell me how to convert a date in (tuesday,may 17,2005) to a date in(17/05/2005) format.

    is it possibleto dowith the helpof formatdatetime() function. if possible how ?

    thank u

    anish

  2. #2
    SitePoint Wizard
    Join Date
    Nov 2004
    Location
    Nelson BC
    Posts
    2,310
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If this doesn't work:
    mystring = FormatDateTime(mydate, vbShortDate)

    then do it manually:

    Function ZeroPad(thing,length)
    sThing = CStr(thing)
    Do While Len(sThing) < length
    sThing = "0" & sThing
    Loop
    ZeroPad = sThing
    End Function

    mystring = ZeroPad(Day(mydate),2) & "/" & ZeroPad(Month(mydate),2) & "/" & ZeroPad(Year(mydate),4)


Bookmarks

Posting Permissions

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