All pastes #910954 Raw Edit

Untitled

public text v1 · immutable
·published 2008-02-20 10:48 UTC
rendered paste body
<form name="dform">
<input type="text" name="currentdate" size=11>
</form>


<script>

/*Current date in form credit: 
JavaScript Kit (www.javascriptkit.com)
Over 200+ free scripts here!
*/

var mydate=new Date()
var theyear=mydate.getYear()
if (theyear < 1000)
theyear+=1900
var theday=mydate.getDay()
var themonth=mydate.getMonth()+1
if (themonth<10)
themonth="0"+themonth
var theday=mydate.getDate()
if (theday<10)
theday="0"+theday

//////EDIT below three variable to customize the format of the date/////

var displayfirst=themonth
var displaysecond=theday
var displaythird=theyear

////////////////////////////////////

document.dform.currentdate.value=displayfirst+"/"+displaysecond+"/"+displaythird
</script>