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

iphone - How do I make a UIPickerView in a UIActionSheet -

java - Is there an object like a "Set" that can contain only unique string values, but also contain a count on the number of occurrences of the string value? -