0

Here is my JS which will show current day date and month.

Example (month/day): 08/01/2015:

http://www.domain.com/0801

The problem is there is no zero infront of them and become like:

http://www.domain.com/81

How to add 0 infront of them so will become 0801

Here is the code

    var currentTime = new Date();
    var month = currentTime.getMonth() + 1
    var day = currentTime.getDate();
    var year = currentTime.getFullYear();
Jason Lee
  • 13
  • 5

0 Answers0