mysql - How to get duration in terms of minutes by subtracting a previous time stamp from the present time in PHP? -


How to obtain the duration of minutes by reducing the stamp from the current time in PHP

2009-12-05 10:35:28

I want to calculate how many minutes have passed. How to do this

If you do not want to add a library, you can do it very easily:

  & lt ;? Php $ date1 = "2009-12-05 10:35:28"; $ Date2 = "2009-12-07 11:58:12"; $ Diff = strtotime ($ date2) - strtotime ($ date1); $ Mins_pass = $ $ diff / 60; Echoes the distance of $ minutes per minute "Minute" $ date1 "And". $ Date2; ? & Gt;  

Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

jquery - SimpleModal Confirm fails to submit form -

php - Multiple Select with Explode: only returns the word "Array" -