PHP Classes

datetime difference: calculate datetime difference

Recommend this page to a friend!
  All requests RSS feed  >  datetime difference  >  Request new recommendation  >  A request is featured when there is no good recommended package on the site when it is posted. Featured requests  >  No recommendations No recommendations  

datetime difference

Edit

Picture of Anant kumar singh by Anant kumar singh - 8 years ago (2015-04-14)

calculate datetime difference

This request is clear and relevant.
This request is not clear or is not relevant.

+1

how to find two date difference . means the product post houre

Ask clarification

2 Recommendations

Very precise date difference: Calculate the days between dates within any years

This recommendation solves the problem.
This recommendation does not solve the problem.

0

Picture of zinsou A.A.E.Moïse by zinsou A.A.E.Moïse package author package author Reputation 5840 - 6 years ago (2017-07-20) Comment

compute-the-precise-number-of-days-between-two-dates

  • 1 Comment
  • 1. Picture of zinsou A.A.E.Moïse by zinsou A.A.E.Moïse package author package author - 6 years ago (2017-08-02) Reply

    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
    								;
    


PHP Date Math Class: Perform operations with dates with long year range

This recommendation solves the problem.
This recommendation does not solve the problem.

+1

Picture of Bob Wedwick by Bob Wedwick package author package author Reputation 30 - 8 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
: 
: