Recommend this page to a friend! |
All requests | > | datetime difference | > | Request new recommendation | > | Featured requests | > | No recommendations |
by Anant kumar singh - 9 years ago (2015-04-14)
+1 | how to find two date difference . means the product post houre |
0 | by zinsou A.A.E.Moïse 5850 - 7 years ago (2017-07-20) Comment compute-the-precise-number-of-days-between-two-dates |
1. by zinsou A.A.E.Moïse Reply
- 7 years ago (2017-08-02)AS i dig a little more,i find a way based on the same algorithm to compute time difference too.So i provide this other package for datetime difference : Package number https://www.phpclasses.org/package/10412-PHP-compute-the-exact-duration-within-two-dates.html(not yet approved but it will) this package provide a method to return the duration in the format that you have chosen in this set with a parameter to keep null value or not:
case "m": float number milleniums
case "c": float number centuries
case "y": float number years
case "d": float number days
case "h": float number hours
case "i": float number minutes
case "mc": string((int)millenium and (float) century)
case "mcydhis": string(millenium centuries years days hours minutes and seconds)
case "cydhis": string( centuries years days hours minutes and seconds)
case "ydhis": string(years days hours minutes and seconds)
case "dhis": string(days hours minutes and seconds)
case "his": string( hours minutes and seconds)
case "is": string( minutes and seconds)
case "s": seconds
default: in seconds
;
+1 | by Bob Wedwick 30 - 9 years ago (2015-05-13) Comment This class computes differences between two dates in days, seeks, months, or years but not in hours, minutes, seconds. When times are used, they may affect the computation by plus or minus one. Time may be formatted as AM/PM or 24-hour time. Dates can have several different formats. |
Recommend package | |
|