-1

I want it to be like this:

Hi thanks for reading this, today it's the 15th of september

Ole V.V.
  • 81,772
  • 15
  • 137
  • 161
Sapotick
  • 9
  • 2
  • Stack Overflow is not a free code writing service. You are expected to try to write the code yourself. After doing [more research](http://meta.stackoverflow.com/questions/261592) if you have a problem you can post what you've tried with a clear explanation of what isn't working and providing a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example). I suggest reading [How to Ask a good question](https://stackoverflow.com/questions/how-to-ask). Also, be sure to [take the tour](https://stackoverflow.com/tour). – bfris Sep 15 '19 at 16:37

2 Answers2

0

It's very simple. you can use the date function of Javascript.

<div id="mydiv"></div>

<script>
var el = document.getElementById('mydiv');
var d = new Date();
el.innerHTML = d;
</script>

jihuuNI
  • 551
  • 2
  • 5
  • 17
0
<p id="elem"></p>
<script>
var d = new Date();
var month = new Array();
month[0] = "January";
month[1] = "February";
month[2] = "March";
month[3] = "April";
month[4] = "May";
month[5] = "June";
month[6] = "July";
month[7] = "August";
month[8] = "September";
month[9] = "October";
month[10] = "November";
month[11] = "December";
var n = month[d.getMonth()];
var day= d.getDate();
var display= "Hi thanks for reading this, today it's the"+day+"th"+
" "+"of"+" "+n;
var elem=document.getElementById('elem');
elem.innerHTML=display;
</script>
Janaka
  • 481
  • 4
  • 14