Previous and Next Date in JavaScript

<script>
var date = new Date();
var prevDate=new Date();
var nextDate=new Date();
prevDate.setDate(date.getDate() - 1);
nextDate.setDate(date.getDate() + 1);
var curdate=date.getFullYear()+"-"+parseInt(date.getMonth()+1)+"-"+date.getDate();
var next=prevDate.getFullYear()+"-"+parseInt(prevDate.getMonth()+1)+"-"+prevDate.getDate();
var prev=nextDate.getFullYear()+"-"+parseInt(nextDate.getMonth()+1)+"-"+nextDate.getDate();
console.log(next+" "+curdate+" "+prev+" ");
</script>

Disabling “Use Socket For PHP-FPM” did the trick.


Leave a Reply