Posts

Showing posts with the label datetime

How To Decease Fourth Dimension Together With Engagement From Datetime Postage Inwards Php Together With Mysql?

You tin dismiss operate the strtotime php component to variety appointment together with fourth dimension from datetime string. It tin dismiss come upwards inwards handy when you lot take away to variety appointment together with fourth dimension from datetime format inwards the mysql database. $datetime = '2013-08-14 11:45:45'; echo date("Y-m-d",strtotime($datetime)); // output 2013-08-14 echo date("H:i:s",strtotime($datetime)); // output 11:45:45 Small together with uncomplicated solution. :) Sumber http://developer-paradize.blogspot.com

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'; } I...