Return to Snippet

Revision: 48281
at June 28, 2011 05:57 by vagrantradio


Initial Code
var currentTime = new Date()
var month = ("0" + (currentTime.getMonth() + 1)).slice(-2)
var day = currentTime.getDate()
var year = currentTime.getFullYear()
//insert into form
var frm = document.getElementById('contact-form'); 
frm.dater.value = (year + "-" + month + "-" + day)

Initial URL

                                

Initial Description

                                

Initial Title
JavaScript Date Formatting

Initial Tags
date

Initial Language
JavaScript