Displaying Current date(mm/dd/yyyy) using Javascript

Displaying Current date(mm/dd/yyyy) using Javascript

By displaying current date in our sites, we can give a more professional appearance to our sites. The following JavaScript code will display the date on our web in the following format:

<SCRIPT language=”JavaScript”>
var currentdate_date= new Date()
var month=currentdate_date.getMonth()+1
var currentdate=currentdate_date.getDate()
var year=currentdate_date.getYear()
//document.write(”currentdate’s date is: “)
document.write(month+”/”+currentdate+”/”+year)
</SCRIPT>

Leave a Reply

You must be logged in to post a comment.


All material @ copyrighted by chrisranjana.com. If you want to link to this article you are welcome to do so. Unauthorized publication is strictly prohibited. This developer tutorial website contains articles by Php programmers , Software developers, Mysql programmers and asp c# programmers. This website also contains ajax tutorials and advanced mysql sql stored procedures and functions tutorials and sample codes.