To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here
PHPBuilder.com  
 

 

Go Back   PHPBuilder.com > PHP Help > Upgrading PHP

Upgrading PHP Issues concerning PHP version upgrades and future releases

Reply
 
Thread Tools Rate Thread Display Modes
Old 08-02-2004, 07:59 AM   #1
kenny_inuk
Junior Member
 
Join Date: Aug 2004
Posts: 2
is date between dates? -- Please help

hi,
i am trying to create a function that will return true if a date is between two set dates and a false if it is not.
for example: (dd/mm/yyyy)
date 1: 02/03/2004
date 2: 05/06/2004

date we want to check: 01/04/2004

function: returns true

unfortuatly i have had a mantal block on how to create one for a couple of days now and could not find any example on the web.

please could any one help


Thanks
kenny
kenny_inuk is offline   Reply With Quote
Old 08-02-2004, 09:39 AM   #2
Shrike
Not Yet Involved
 
Shrike's Avatar
 
Join Date: Oct 2003
Location: The Eighth, Sursamen
Posts: 2,254
This isn't really a PHP5 question, but anyway, here's an example
PHP Code:
function isDateBetween($dt_start, $dt_check, $dt_end){
  if(
strtotime($dt_check) > strtotime($dt_start) && strtotime($dt_check) < strtotime($dt_end)) {
    return
true;
  }
  return
false;
}
isDateBetween("2004-01-01", "2004-01-02", "2004-01-03")
  and
doStuffHooray();
__________________
The Hundredth Idiot
Shrike is offline   Reply With Quote
Old 08-02-2004, 09:46 AM   #3
kenny_inuk
Junior Member
 
Join Date: Aug 2004
Posts: 2
Top notch!

Thank you VERY much!

Quote:
This isn't really a PHP5 question
Sorry! i must be more observant in the future !
kenny_inuk is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 11:42 PM.






Acceptable Use Policy

internet.comMediabistrojusttechjobs.comGraphics.com

WebMediaBrands Corporate Info


Advertise | Newsletters | Feedback | Submit News

Legal Notices | Licensing | Permissions | Privacy Policy


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.