| | |
Calculate working days between dates
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Dec 2007
Posts: 6
Reputation:
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
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.
Ignorance is definitely not bliss!
*PM asking for help will be ignored*
*PM asking for help will be ignored*
![]() |
Similar Threads
- 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: Grab Mp3 Files and Play online
- Next Thread: Displaying teaser when rolling over link.
| Thread Tools | Search this Thread |
.htaccess ajax apache api array beginner binary broken buttons cakephp checkbox class cms code cron curl database date directory display dynamic ebooks echo email error file files folder form forms function functions google href htaccess html image include insert integration ip java javascript joomla limit link login loop mail mediawiki menu mlm mod_rewrite multiple mysql number oop paypal pdf php phpincludeissue phpmyadmin problem query radio random recursion regex remote script search server sessions sms soap source sp space speed sql subdomain syntax system table tag tutorial update upload url validation validator variable vbulletin video web webdesign websphere white xml youtube






