How To Banking Concern Tally If 24 Hours Convey Passed Inwards Php?

You convey inwards php strtotime() purpose to convert human readable dates to timestamps. Using strtotime purpose you lot tin easily compare dates or timestamp amongst php.

In the next example, I convey converted the ii dates into timestamp using strtotime purpose in addition to stored inwards course of educational activity variables. You tin produce many things for instance, compare ii dates to uncovering out which appointment is greater or lower. I convey to uncovering out if the appointment convey been to a greater extent than than 24 hours, then I did next method, if 24 hours convey passed.

 // your get-go appointment coming from a mysql database (date fields)  $dateA = '2013-11-11 23:10:30';  // your minute appointment coming from a mysql database (date fields)  $dateB = '2013-11-11 16:27:21';   $timediff = strtotime($dateA) - strtotime($dateB);  if($timediff > 86400){      echo 'more than 24 hours'; } else {  echo 'less than 24 hours'; } 

If it exists other ways to accomplish it, delight percentage it. :)

Sumber http://developer-paradize.blogspot.com

Comments

Popular posts from this blog

What Are The Main Components of a Computer System

Top Qualities To Look For In An IT Support Team

How To Integrate Google Adwords Api Into Codeigniter?