Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: now() format

  1. #1
    New Coder
    Join Date
    Aug 2003
    Posts
    82
    Thanks
    0
    Thanked 0 Times in 0 Posts

    now() format

    Hello
    now() gives a mm/dd/yyyy format and I want a dd/mm/yyyy.

    thanks anyone

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,033
    Thanks
    0
    Thanked 248 Times in 245 Posts
    Code:
    function FormatDate(ByVal d)
      'formats date to DD/MM/YYYY 
      dim mm,dd,yy
      if not isdate(d) then exit function
      mm = Month(d)
      if mm<10 then mm="0"&mm
      dd = Day(d)
      if dd<10 then dd="0"&dd
      yy = Year(d)
      FormatDate = dd & "/" & mm & "/" & yy
    end function
    
    response.write "Now:" & FormatDate(Now()) & "<br>"
    response.write "Christmas:" & FormatDate("12/25/2003") & "<br>"


  •  

    Posting Permissions

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