•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 455,985 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,772 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 2251 | Replies: 3
![]() |
•
•
Join Date: Dec 2007
Posts: 6
Reputation:
Rep Power: 0
Solved Threads: 0
Hi,
I need to calculate the number of working days between 2 dates entered in a page using PHP. The dates and the calculated number then need to be put into a MySQL database.
I am new to PHP, but understand the linking to the database and basic fnctions within PHP. Unfortunately I'm struggling with the calculation of the working days between dates.
Any help will be appreciated!
Thank You!
Steve
I need to calculate the number of working days between 2 dates entered in a page using PHP. The dates and the calculated number then need to be put into a MySQL database.
I am new to PHP, but understand the linking to the database and basic fnctions within PHP. Unfortunately I'm struggling with the calculation of the working days between dates.
Any help will be appreciated!
Thank You!
Steve
•
•
Join Date: Nov 2007
Location: Bangalore, India
Posts: 3,098
Reputation:
Rep Power: 8
Solved Threads: 240
php Syntax (Toggle Plain Text)
<?php $date1="2007-11-04"; //date 1 smaller than the 2nd date $date2="2007-12-06"; $difference= (strtotime($date2) - strtotime($date1))/(24*60*60); print $difference; ?>
Hope it helps.
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
*PM asking for help will be ignored*
*PM asking for help will be ignored*
![]() |
•
•
•
•
•
•
•
•
DaniWeb PHP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Please Help! (Visual Basic 4 / 5 / 6)
- Difference between 2 dates by month (MS Access and FileMaker Pro)
Other Threads in the PHP Forum
- Previous Thread: PLEASE HELP .. Parse error: syntax error, unexpected T_PRIVATE, expecting ']'
- Next Thread: Displaying teaser when rolling over link.



Linear Mode