Formatting date...

Results 1 to 2 of 2

Thread: Formatting date...

  1. #1
    PersonalFoul Guest

    Default Formatting date...

    I have a javascript function that returns a value to a textbox. Problem is it is returning the date as:<BR><BR>Tue May 25 00:00:00 EDT 2004<BR><BR>I want it returned as 05/25/2004 or 5/25/04. What formatting function can I use to achieve this?

  2. #2
    Join Date
    Dec 1969

    Default RE: Formatting date...

    var curdate = new Date(EndDate);<BR>var finalyear = curdate.getYear();<BR>var finalmonth = curdate.getMonth();<BR> finalmonth = finalmonth + 1; //because month is zero based<BR>var finalday = curdate.getDate();<BR><BR>Then assemble these variables into any format you like.

Posting Permissions

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