IT SOLUTIONS
Your full service technology partner! 
-Collapse +Expand
PHP
Search PHP Group:

Advanced
-Collapse +Expand PHP Store
PRESTWOODSTORE

Prestwood eMagazine

July Edition
Subscribe now! It's Free!
Enter your email:

   ► MB LobbyPHP & Delphi for PHP BoardPHP Topic   Print This     

Date Diff - php

Date Diff - php in PHP topic (part of our PHP & Delphi for PHP group).

Quick Search: Date Diff   Date Diff php  
ScottCybak
 (Inactive)
Windsor, Ontario, Canada
Anyone know how to calculate the number of days between 2 given dates in php?

TIA
 Posted 20 years ago (Thread Starter)
Comment Quote
About ScottCybak -Collapse +Expand
Visit Profile
Inactive member.
Member does not subscribe to this thread.
Email Not Verified!
Once email is verified, we will review and approve the account.
Web Presence Hidden.
Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

Post ID #3131, 1 replies
Thread Started 7/31/2001 7:47:00 PM
View Counter=3250
Last Reply Posted 8/6/2001 3:03:00 PM)
Location=Windsor, Ontario, Canada  
Joined=20 years ago   MB Posts=64  
Most Recent Post
Larry J. Rutledge
Prestwood IT
Citrus Heights, CA USA
Scott,

Here is a function to calculate the difference between to dates, in days (assuming the dates are PHP timestamps):


function dateDiff($date1, $date2) {
/*=========================================
Description: This will calculate the
difference, in days, between the two
supplied dates.
Assumptions: Date1 is larger than Date2
(If not, the function will return -1)
=========================================*/
if ($date1 > $date2) {
$calc_day_diff = ($date1 - $date2) / 86400;
}
else {
$calc_day_diff = -1;
}

return ($calc_day_diff);
}


I hope this helps,
Larry
Larry J. Rutledge

Analyst

Prestwood Software

www.prestwood.com
 Posted 20 years ago
Comment Quote
About Larry J. Rutledge -Collapse +Expand
Visit Profile
Approved member.
Member subscribes to this thread with a verified email.
About Larry J. Rutledge
I worked for Prestwood Software as a Delphi developer from 1997 through 2002. During that time I enjoyed working with Mike Prestwood and the other developers at Prestwood.

Post ID #3251 (Level 1.1)  Reply to 3131
Thread Started 8/6/2001 3:03:00 PM
View Counter=2
Location=Citrus Heights, CA USA 
Joined=21 years ago   MB Posts=73   KB Posts=9  

Revive Thread!

Add a comment to revive this old thread and make this archived thread more useful.

Write a Comment...
Full Editor
...
Sign in...

If you are a member, Sign In. Or, you can Create a Free account now.


Anonymous Post (text-only, no HTML):

Enter your name and security key.

Your Name:
Security key = P1273A1
Enter key:
Icon: A Post    Thread    Idea    Important!    Cool    Sad    No    Yes    Includes a Link...   
Thread #3131 Counter
3250
Since 4/2/2008
Go ahead!   Use Us! Call: 916-726-5675  Or visit our new sales site: 
www.prestwood.com


©1995-2021 Prestwood IT Solutions.   [Security & Privacy]