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.
How to create or perform html format date?
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>
How to create or perform html format date?
Â
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/date
Thanks,
Janneya Erskine