skip to Main Content

PHP date->modify and date_add. Why results of this two functions are the same?

I wrote this function $today=new DateTime(date('Y-m-d')); $tomorrow=new DateTime(); $tomorrow=$today->modify('+1 day'); $interval= new DateInterval('P7D'); $enDt= date_add($today,$interval); var_dump($tomorrow->format('d-m-Y'), $enDt->format('d-m-Y')); and I expected $tomorrow should be different from $enDt, because, in the first case, I increase $today of 1 day, and in the…

VIEW QUESTION

in javascript , why the date is not getting stored in targetdate variable taken from the prompt

const seconds=1000, minute=60*seconds,hours= 60*minute,day= 24*hours; const days= document.querySelector(".days"); const hrs= document.querySelector(".hrs"); const min= document.querySelector(".min"); const sec= document.querySelector(".sec"); //main target //function const timerfunction =()=>{ let dd = prompt("Enter Date").padStart(2,"0"); let mm = prompt("Enter Month").padStart(2,"0"); let yyyy =prompt ("Enter Year") ; console.log(`${dd}/${mm}/${yyyy}`);…

VIEW QUESTION
Back To Top
Search