Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

insert current time

Status
Not open for further replies.

wblue

Technical User
May 25, 2001
131
US
I am using the following java script to insert the date into a form field. I need to know how to add to this script to include the time along with the date.

var newdate = new Date();
var thisfieldis = this.getField("date");

var theday = util.printd("dddd",newdate);
var thedate = util.printd("d",newdate);
var themonth = util.printd("mmmm",newdate); var theyear = util.printd("yyyy",newdate);

thisfieldis.value = theday + " " + thedate + ", " + themonth + " " + theyear;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top