Click to See Complete Forum and Search --> : Format Date


stretcher25
12-06-2004, 06:47 AM
How do I format this:

Dec 7 00:00:00 EST 2004

into this:

12/7/2004

in a textbox?

candelbc
12-06-2004, 12:05 PM
If I am understanding you correctly, you want to take the current date and convert it into a INPUT tag within a form.

This is how I would do it.

<input type="text" name="textfield" value="<%= FormatDateTime(Date(), vbShortDate)%>">

-Hope this is what you were looking for.

stretcher25
12-06-2004, 12:43 PM
actually I have a JavaScript that puts a date that's stored in the database into the textbox, but it puts it in a format like Dec 7 00:00:00 EST 2004, I want it to be showed like 12/7/2004. The JavaScript forum told me to ask you guys how to do it in asp.