How to create or perform html format date?

Asked By 60 points N/A Posted on -
qa-featured

Hello Experts,

How to create or perform html format date? I got my own webpage creation for my project and I want to make an automatic date setting for this website but how will I be going to make html format date? I am so confused, I wish you can give me some video tutorial regarding this matter.

SHARE
Best Answer by Janneya erskine
Answered By 0 points N/A #188023

How to create or perform html format date?

qa-featured

Try Blow code

<code>
<html>
</head>
<body>
<script>
var mydate=new Date()
var year=mydate.getYear()
if (year < 1000) year+=1900
var day=mydate.getDay()
var month=mydate.getMonth()
var daym=mydate.getDate()
if (daym<10) daym="0"+daym
var dayarray=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
var montharray=new Array("January","February","March","April","May","June","July","August","September","October","Novem ber","December")
document.write(""+montharray[month]+" "+daym+", "+year+"")
</script>
</body>
</html>
</code>

Best Answer
Best Answer
Answered By 0 points N/A #188024

How to create or perform html format date?

qa-featured

 

Hi Stephen,

Try out the below mentioned script which will resolve your query in creating HTML format date.

<code>

<html>

</head>

<body>

<script type="text/javascript">

<!–

var currentTime = new Date()

var month = currentTime.getMonth() + 1

var day = currentTime.getDate()

var year = currentTime.getFullYear()

document.write(month + "/" + day + "/" + year)

//–>

</script>

</body>

</html>

</code>

 

Also the following links will help you as a tutorial for the same

http://javascript.info/tutorial/datetime-functions

Thanks,

Janneya Erskine

Login/Register to Answer

Related Questions