Home
Developer Blog
Ajax effects
CSS examples
Freelance jobs
Hot IT Jobs
Hot scripts
Code samples
Web hosting directory
Lotus Notes FAQ
See the new scripts recently added to Dynamic Drive.
Click here
.
Original, practical
CSS codes and examples
such as CSS menus for your site.
Search code samples
Keyword
All Categories
ASP
CSS
Dhtml
Html
Javascript
PHP
Code Samples
ASP
CSS
Dhtml
Html
Javascript
PHP
LOGIN HERE
Username
Password
Signup Now
Forgot Password
Verify Signup
Javascript >> General
how to write Date and Time using javascript?
Visitor Ratings (0) :
Description
The getMonth() function gives us the month in a numeric form. To convert this value into the month name, we will employ an array. The array would contain all the 12 month names.
Code
Select All
<SCRIPT LANGUAGE="JAVASCRIPT"> <!-- var m_names = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"); var d = new Date(); var curr_date = d.getDate(); var curr_month = d.getMonth(); var curr_year = d.getFullYear(); document.write(curr_date + "-" + m_names[curr_month] + "-" + curr_year); //--> </SCRIPT>
Rate this Resource
0
1
2
3
4
5
6
7
8
9
10