0

I need one help.I need to measure the time interval in terms of days,hour,min,sec comparing with today's date time using PHP.My time format is given below.

$date=2016-02-11 10:17:36

Its datatype is datetime.Please help me.

  • actually here i need the actual time difference whether it is some hour or min or sec or days any one. –  Feb 11 '16 at 07:19
  • jurkas answer http://stackoverflow.com/a/3923228/1037640 will do the job for you too. Have a look at http://nl1.php.net/manual/en/class.dateinterval.php for getting the interval in the desired format. – DerVO Feb 11 '16 at 07:29
  • i have checked those but here i need suppose my existing datetime is `2016-02-11 10:17:36` and if i will check this tomorrow it will calculate difference as days other wise it should hour or min or sec accordingly. –  Feb 11 '16 at 07:35

0 Answers0