<script>
var today = new Date();
var date = today.getFullYear()+'-'+(today.getMonth()+1)+'-'+today.getDate();
var time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds();
var dateTime = date+' '+time;
</script>
Try this:
tomorrow = new Date(today.getTime() + 1000 * 60 * 60 * 24)
One day equals 24h = 24 * 60 minutes = 24 * 60 * 60 seconds = 24 * 60 * 60 * 1000 miliseconds
Edit: I might have misunderstood the question, but if what you want to achieve is adding 1 day to your variable, this will work. 😄
You can use toLocaleString() Date method to get that format
let actualDate = new Date().toLocaleString(); // Output: d/m/yyyy h:mm:ss
console.log(actualDate)
If you’re looking for the day of the week, then today.getDay() will return a numerical day of the week from 0-6. You could then use an array with the day names in to refer to the text for the day of the week.
For example:
var days = [“Monday”, “Tuesday”, “Wednesday”, “Thursday”, “Friday”, “Saturday”, “Sunday”];
var today = new Date();
var date = today.getFullYear()+'-'+(today.getMonth()+1)+’-‘+today.getDate()+’-‘+days[today.getDay()];