• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 149
  • Last Modified:

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
0
Aleks
Asked:
Aleks
1 Solution
 
amit_gCommented:
return today.getMonth()+1+"/"+today.getDate()+"/"+(today.getYear()) + " " + (today.getHours()) + ":" + (today.getMinutes()) + ":" + (today.getSeconds())
0
 
AleksAuthor Commented:
Excellent .. thank you !!!
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now