Javascript for date and time

I have the following Javascript, this gives me the date, but not the time. Can someone help me modify it so that it includes the time as well ?

<% function todayStr() {
var today=new Date()
return today.getMonth()+1+"/"+today.getDate()+"/"+(today.getYear())
}
%>

Thanks,

Aleks
LVL 1
AleksAsked:
Who is Participating?
 
amit_gCommented:
return today.getMonth()+1+"/"+today.getDate()+"/"+(today.getYear()) + " " + (today.getHours()) + ":" + (today.getMinutes()) + ":" + (today.getSeconds())
0
 
AleksAuthor Commented:
Excellent .. thank you !!!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.