Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2004
    Posts
    77

    Unanswered: DateAdd function and format date

    dim coudate
    coudate=request.querystring("numdateadd")
    <%=DateAdd("d",coudate,date()%>

    I want the result to show date in form year/month/day so I tried

    <%=DateAdd("d",coudate,year(now())&"/"&month(now())&"/"&day(now()))%>

    But the result stll show day/month/year. Anyone know how to format date to show year/month/day

  2. #2
    Join Date
    Jul 2003
    Location
    SoCal
    Posts
    721
    Code:
    <%
      dim coudate 
    
      coudate = DateAdd("d",request.querystring("numdateadd"),Now())
    
      Response.Write Year(coudate) & "/" & Month(coudate) & "/" & Day(coudate)
    %>
    That which does not kill me postpones the inevitable.

  3. #3
    Join Date
    Jul 2004
    Posts
    94
    I hope, the code suggested by Seppuku has helped you out. if not let me know there is one more way of doing that.
    Priyanka
    Windows web hosting with ASP,.Net,PHP,Perl,MySQL support
    We help in making your dreams come true on internet!

Posting Permissions

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