Could somebody get me started on a PHP switch or IF ELSE function to set the
current week of a football season. Right now I am setting the date manually
each week with the following:
<?php
// function TO GET curweek of football season
function getCurWeek() {
$curWeek = '05';
return $curWeek;
} // end of getCurWeek
?>
Ideally I want to test the current date if it's between the start and end
date of each week. The wrinkle is and I need to adjust somehow, the pro
season is 1-week behind the college season and anything past curweek['15']
will be 'PS' post season for college and past curweek['17'] for pro's will
be 'PS' if you follow. I'll probably have to return two values instead of
the 1 that I'm doing now. I tried several and my php date syntax doesn't
work.
Gary Jeurink
--- StripMime Report -- processed MIME parts ---
multipart/alternative
text/plain (text body -- kept)
text/html
---
_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/13EA54DEA75244F7827B856A3D43524E@OwnerPC
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Here is some code I use for changing video's each day
Should be self explanatory, but if not, give me a shout
<?php
//Give what day of the week it is. Returns Sunday through Saturday.
$day = date("l");
if ($day == "Monday")
{
// Clint Eastwood
echo '<iframe width="510" height="315"
src="http://www.youtube.com/embed/tFAiqxm1FDA" frameborder="0"
allowfullscreen></iframe>';
// Gomer Pyle
echo '<iframe width="510" height="315"
src="http://www.youtube.com/embed/r5KeGccP9Jk?feature=player_embedded"
frameborder="0" allowfullscreen></iframe>';
}
elseif ($day == "Tuesday")
{
// College Girl
echo '<iframe width="510" height="315"
src="http://www.youtube.com/embed/j6iqTHJHW5o?feature=player_embedded"
frameborder="0" allowfullscreen></iframe>';
// Clint Eastwood
echo '<iframe width="510" height="315"
src="http://www.youtube.com/embed/tFAiqxm1FDA" frameborder="0"
allowfullscreen></iframe>';
}
elseif ($day == "Wednesday")
{
echo '<iframe width="510" height="315"
src="http://www.youtube.com/embed/r5KeGccP9Jk?feature=player_embedded"
frameborder="0" allowfullscreen></iframe>';
echo '<iframe width="510" height="315"
src="http://www.youtube.com/embed/tFAiqxm1FDA" frameborder="0"
allowfullscreen></iframe>';
}
elseif ($day == "Thursday")
{
echo '<iframe width="510" height="315"
src="http://www.youtube.com/embed/r5KeGccP9Jk?feature=player_embedded"
frameborder="0" allowfullscreen></iframe>';
echo '<iframe width="510" height="315"
src="http://www.youtube.com/embed/tFAiqxm1FDA" frameborder="0"
allowfullscreen></iframe>';
}
elseif ($day == "Friday")
{
echo '<iframe width="510" height="315"
src="http://www.youtube.com/embed/r5KeGccP9Jk?feature=player_embedded"
frameborder="0" allowfullscreen></iframe>';
echo '<iframe width="510" height="315"
src="http://www.youtube.com/embed/tFAiqxm1FDA" frameborder="0"
allowfullscreen></iframe>';
}
elseif ($day == "Saturday")
{
echo '<iframe width="510" height="315"
src="http://www.youtube.com/embed/r5KeGccP9Jk?feature=player_embedded"
frameborder="0" allowfullscreen></iframe>';
echo '<iframe width="510" height="315"
src="http://www.youtube.com/embed/tFAiqxm1FDA" frameborder="0"
allowfullscreen></iframe>';
}
elseif ($day == "Sunday")
{
echo '<iframe width="510" height="315"
src="http://www.youtube.com/embed/r5KeGccP9Jk?feature=player_embedded"
frameborder="0" allowfullscreen></iframe>';
echo '<iframe width="510" height="315"
src="http://www.youtube.com/embed/1sJl5OC7LCU?feature=player_embedded"
frameborder="0" allowfullscreen></iframe>';
}
?>
-----Original Message-----
From: ProFox [mailto:profox-bounces@leafe.com] On Behalf Of Gary Jeurink
Sent: Tuesday, September 24, 2013 1:09 PM
To: 'ProFox Email List'
Subject: php date function
Could somebody get me started on a PHP switch or IF ELSE function to set the
current week of a football season. Right now I am setting the date manually
each week with the following:
<?php
// function TO GET curweek of football season
function getCurWeek() {
$curWeek = '05';
return $curWeek;
} // end of getCurWeek
?>
Ideally I want to test the current date if it's between the start and end
date of each week. The wrinkle is and I need to adjust somehow, the pro
season is 1-week behind the college season and anything past curweek['15']
will be 'PS' post season for college and past curweek['17'] for pro's will
be 'PS' if you follow. I'll probably have to return two values instead of
the 1 that I'm doing now. I tried several and my php date syntax doesn't
work.
Gary Jeurink
--- StripMime Report -- processed MIME parts --- multipart/alternative
text/plain (text body -- kept)
text/html
---
[excessive quoting removed by server]
_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/096201ceb952$736cf3a0$5a46dae0$@gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
On 09/24/13 11:09 AM, Gary Jeurink wrote:
> Could somebody get me started on a PHP switch or IF ELSE function to set the
> current week of a football season. Right now I am setting the date manually
> each week with the following:
For my Fantasy Football tracking program I do the following:
a. I maintain CurrentWeek as a saved parameter in my oApp object.
Values are 0-17, 0 is pre-season projections.
b. On firing up, CurrentWeek is displayed, with a button to change it.
Usually change it once, at the beginning of a weeks' activities.
c. Most actions display oApp.CurrentWeek and verify that this is what
you want before printing reports etc.
Since I do a lot of different things for a week, this is easier than
trying to calculate it each time I fire up.
Easy to change to CollegeWeek and ProWeek for your use.
Dan
_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/5241F31A.7050405@san.rr.com
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
On Tue, Sep 24, 2013 at 3:16 PM, Dan Covill <dcovill@san.rr.com> wrote:
> On 09/24/13 11:09 AM, Gary Jeurink wrote:
>
>> Could somebody get me started on a PHP switch or IF ELSE function to set
>> the
>> current week of a football season. Right now I am setting the date
>> manually
>> each week with the following:
>>
>
> For my Fantasy Football tracking program I do the following:
> a. I maintain CurrentWeek as a saved parameter in my oApp object.
> Values are 0-17, 0 is pre-season projections.
>
> b. On firing up, CurrentWeek is displayed, with a button to change it.
> Usually change it once, at the beginning of a weeks' activities.
>
> c. Most actions display oApp.CurrentWeek and verify that this is what
> you want before printing reports etc.
>
> Since I do a lot of different things for a week, this is easier than
> trying to calculate it each time I fire up.
>
> Easy to change to CollegeWeek and ProWeek for your use.
> ------------
Why not have it date driven in a table? You just have to figure out what
your day of the week is to use. Thursday or Monday?
--
Stephen Russell
Sr. Analyst
Ring Container Technology
Oakland TN
901.246-0159 cell
--- StripMime Report -- processed MIME parts ---
multipart/alternative
text/plain (text body -- kept)
text/html
---
_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/CAJidMYLh4KU4z623qe-doW_2ZSaSuSyBbhCpzh3X06oa2bd4sQ@mail.gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
I struggle because I'm not good with the date data type. My first failure
was to count the weeks between the start date and the current date and I
failed. Then I built a PHP switch trap with current date falling between two
dates or after being post season, would be perfect. When I hover on the ESPN
week selector, it reveals the two dates.
How do I code an IF current date between date1 and date2?
The difference between college and pro is a separate problem that I think I
can handle. ... I like your solution and am googling for a between dates php
solution.
Gary
-----Original Message-----
From: Virgil Bierschwale [mailto:vbiersch@gmail.com]
Sent: Tuesday, September 24, 2013 1:18 PM
To: 'ProFox Email List'
Subject: RE: php date function
Here is some code I use for changing video's each day
Should be self explanatory, but if not, give me a shout
<?php
//Give what day of the week it is. Returns Sunday through Saturday.
$day = date("l");
if ($day == "Monday")
{
// Clint Eastwood
echo '<iframe width="510" height="315"
src="http://www.youtube.com/embed/tFAiqxm1FDA" frameborder="0"
allowfullscreen></iframe>';
// Gomer Pyle
echo '<iframe width="510" height="315"
src="http://www.youtube.com/embed/r5KeGccP9Jk?feature=player_embedded"
frameborder="0" allowfullscreen></iframe>';
}
elseif ($day == "Tuesday")
{
// College Girl
echo '<iframe width="510" height="315"
src="http://www.youtube.com/embed/j6iqTHJHW5o?feature=player_embedded"
frameborder="0" allowfullscreen></iframe>';
// Clint Eastwood
echo '<iframe width="510" height="315"
src="http://www.youtube.com/embed/tFAiqxm1FDA" frameborder="0"
allowfullscreen></iframe>';
}
elseif ($day == "Wednesday")
{
echo '<iframe width="510" height="315"
src="http://www.youtube.com/embed/r5KeGccP9Jk?feature=player_embedded"
frameborder="0" allowfullscreen></iframe>';
echo '<iframe width="510" height="315"
src="http://www.youtube.com/embed/tFAiqxm1FDA" frameborder="0"
allowfullscreen></iframe>';
}
elseif ($day == "Thursday")
{
echo '<iframe width="510" height="315"
src="http://www.youtube.com/embed/r5KeGccP9Jk?feature=player_embedded"
frameborder="0" allowfullscreen></iframe>';
echo '<iframe width="510" height="315"
src="http://www.youtube.com/embed/tFAiqxm1FDA" frameborder="0"
allowfullscreen></iframe>';
}
elseif ($day == "Friday")
{
echo '<iframe width="510" height="315"
src="http://www.youtube.com/embed/r5KeGccP9Jk?feature=player_embedded"
frameborder="0" allowfullscreen></iframe>';
echo '<iframe width="510" height="315"
src="http://www.youtube.com/embed/tFAiqxm1FDA" frameborder="0"
allowfullscreen></iframe>';
}
elseif ($day == "Saturday")
{
echo '<iframe width="510" height="315"
src="http://www.youtube.com/embed/r5KeGccP9Jk?feature=player_embedded"
frameborder="0" allowfullscreen></iframe>';
echo '<iframe width="510" height="315"
src="http://www.youtube.com/embed/tFAiqxm1FDA" frameborder="0"
allowfullscreen></iframe>';
}
elseif ($day == "Sunday")
{
echo '<iframe width="510" height="315"
src="http://www.youtube.com/embed/r5KeGccP9Jk?feature=player_embedded"
frameborder="0" allowfullscreen></iframe>';
echo '<iframe width="510" height="315"
src="http://www.youtube.com/embed/1sJl5OC7LCU?feature=player_embedded"
frameborder="0" allowfullscreen></iframe>';
}
?>
-----Original Message-----
From: ProFox [mailto:profox-bounces@leafe.com] On Behalf Of Gary Jeurink
Sent: Tuesday, September 24, 2013 1:09 PM
To: 'ProFox Email List'
Subject: php date function
Could somebody get me started on a PHP switch or IF ELSE function to set the
current week of a football season. Right now I am setting the date manually
each week with the following:
<?php
// function TO GET curweek of football season
function getCurWeek() {
$curWeek = '05';
return $curWeek;
} // end of getCurWeek
?>
Ideally I want to test the current date if it's between the start and end
date of each week. The wrinkle is and I need to adjust somehow, the pro
season is 1-week behind the college season and anything past curweek['15']
will be 'PS' post season for college and past curweek['17'] for pro's will
be 'PS' if you follow. I'll probably have to return two values instead of
the 1 that I'm doing now. I tried several and my php date syntax doesn't
work.
Gary Jeurink
--- StripMime Report -- processed MIME parts --- multipart/alternative
text/plain (text body -- kept)
text/html
---
[excessive quoting removed by server]
_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/475E2F0C9BC5498D8B216F5236E62B27@OwnerPC
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
It will be something along these lines:
$day = date("l");
If (($day >=date("I")) or ($day <=date("I")))
W3schools.com is your friend.
http://w3schools.com/php/php_date.asp
for what it's worth, I had a hard time with it as well, and php gets
confusing when you have php, html, etc. mixed together along with whatever
else wordpress throws in.
I've got a problem at kaaw now where wordpress uses zulu time and I've
written my code to display a different header each day.
It's a problem because it changes about 7PM here in texas rather than
midnight, but for now I will live with it as I'm behind in my accounting
classes and class ends this weekend.
-----Original Message-----
From: ProFox [mailto:profox-bounces@leafe.com] On Behalf Of Gary Jeurink
Sent: Friday, September 27, 2013 10:58 AM
To: 'ProFox Email List'
Subject: RE: php date function
I struggle because I'm not good with the date data type. My first failure
was to count the weeks between the start date and the current date and I
failed. Then I built a PHP switch trap with current date falling between two
dates or after being post season, would be perfect. When I hover on the ESPN
week selector, it reveals the two dates.
How do I code an IF current date between date1 and date2?
The difference between college and pro is a separate problem that I think I
can handle. ... I like your solution and am googling for a between dates php
solution.
Gary
-----Original Message-----
From: Virgil Bierschwale [mailto:vbiersch@gmail.com]
Sent: Tuesday, September 24, 2013 1:18 PM
To: 'ProFox Email List'
Subject: RE: php date function
Here is some code I use for changing video's each day
Should be self explanatory, but if not, give me a shout
<?php
//Give what day of the week it is. Returns Sunday through Saturday.
$day = date("l");
if ($day == "Monday")
{
// Clint Eastwood
echo '<iframe width="510" height="315"
src="http://www.youtube.com/embed/tFAiqxm1FDA" frameborder="0"
allowfullscreen></iframe>';
// Gomer Pyle
echo '<iframe width="510" height="315"
src="http://www.youtube.com/embed/r5KeGccP9Jk?feature=player_embedded"
frameborder="0" allowfullscreen></iframe>';
}
elseif ($day == "Tuesday")
{
// College Girl
echo '<iframe width="510" height="315"
src="http://www.youtube.com/embed/j6iqTHJHW5o?feature=player_embedded"
frameborder="0" allowfullscreen></iframe>';
// Clint Eastwood
echo '<iframe width="510" height="315"
src="http://www.youtube.com/embed/tFAiqxm1FDA" frameborder="0"
allowfullscreen></iframe>';
}
elseif ($day == "Wednesday")
{
echo '<iframe width="510" height="315"
src="http://www.youtube.com/embed/r5KeGccP9Jk?feature=player_embedded"
frameborder="0" allowfullscreen></iframe>';
echo '<iframe width="510" height="315"
src="http://www.youtube.com/embed/tFAiqxm1FDA" frameborder="0"
allowfullscreen></iframe>';
}
elseif ($day == "Thursday")
{
echo '<iframe width="510" height="315"
src="http://www.youtube.com/embed/r5KeGccP9Jk?feature=player_embedded"
frameborder="0" allowfullscreen></iframe>';
echo '<iframe width="510" height="315"
src="http://www.youtube.com/embed/tFAiqxm1FDA" frameborder="0"
allowfullscreen></iframe>';
}
elseif ($day == "Friday")
{
echo '<iframe width="510" height="315"
src="http://www.youtube.com/embed/r5KeGccP9Jk?feature=player_embedded"
frameborder="0" allowfullscreen></iframe>';
echo '<iframe width="510" height="315"
src="http://www.youtube.com/embed/tFAiqxm1FDA" frameborder="0"
allowfullscreen></iframe>';
}
elseif ($day == "Saturday")
{
echo '<iframe width="510" height="315"
src="http://www.youtube.com/embed/r5KeGccP9Jk?feature=player_embedded"
frameborder="0" allowfullscreen></iframe>';
echo '<iframe width="510" height="315"
src="http://www.youtube.com/embed/tFAiqxm1FDA" frameborder="0"
allowfullscreen></iframe>';
}
elseif ($day == "Sunday")
{
echo '<iframe width="510" height="315"
src="http://www.youtube.com/embed/r5KeGccP9Jk?feature=player_embedded"
frameborder="0" allowfullscreen></iframe>';
echo '<iframe width="510" height="315"
src="http://www.youtube.com/embed/1sJl5OC7LCU?feature=player_embedded"
frameborder="0" allowfullscreen></iframe>';
}
?>
-----Original Message-----
From: ProFox [mailto:profox-bounces@leafe.com] On Behalf Of Gary Jeurink
Sent: Tuesday, September 24, 2013 1:09 PM
To: 'ProFox Email List'
Subject: php date function
Could somebody get me started on a PHP switch or IF ELSE function to set the
current week of a football season. Right now I am setting the date manually
each week with the following:
<?php
// function TO GET curweek of football season
function getCurWeek() {
$curWeek = '05';
return $curWeek;
} // end of getCurWeek
?>
Ideally I want to test the current date if it's between the start and end
date of each week. The wrinkle is and I need to adjust somehow, the pro
season is 1-week behind the college season and anything past curweek['15']
will be 'PS' post season for college and past curweek['17'] for pro's will
be 'PS' if you follow. I'll probably have to return two values instead of
the 1 that I'm doing now. I tried several and my php date syntax doesn't
work.
Gary Jeurink
--- StripMime Report -- processed MIME parts --- multipart/alternative
text/plain (text body -- kept)
text/html
---
[excessive quoting removed by server]
_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/079f01cebb9b$79ba98c0$6d2fca40$@gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
OKAY along your method I'm going to try...
function getCurWeek2() {
$curDate = Date('Y/m/d');
$firstDate = DateTime::createFromFormat('Y/m/d', '2013/08/27');
$secondDate = DateTime::createFromFormat('Y/m/d', '2013/09/02');
if ($curDate >= $firstDate && $curDate <= $secondDate)
{
$curWeek = '01';
return $curWeek;
} // end of if week 1
$firstDate = DateTime::createFromFormat('Y/m/d', '2013/09/03');
$secondDate = DateTime::createFromFormat('Y/m/d', '2013/09/09');
if ($curDate >= $firstDate && $curDate <= $secondDate)
{
$curWeek = '02';
return $curWeek;
} // end of if week 2 ... upto week 17 and then default to 'PS'
I am learning php as needed... this should work but I'll bet there is
something quicker/cleaner. Thanks you guys
Gary Jeurink
-----Original Message-----
From: Gary Jeurink [mailto:g.jeurink@charter.net]
Sent: Friday, September 27, 2013 10:58 AM
To: 'ProFox Email List'
Subject: RE: php date function
I struggle because I'm not good with the date data type. My first failure
was to count the weeks between the start date and the current date and I
failed. Then I built a PHP switch trap with current date falling between two
dates or after being post season, would be perfect. When I hover on the ESPN
week selector, it reveals the two dates.
How do I code an IF current date between date1 and date2?
The difference between college and pro is a separate problem that I think I
can handle. ... I like your solution and am googling for a between dates php
solution.
Gary
-----Original Message-----
From: Virgil Bierschwale [mailto:vbiersch@gmail.com]
Sent: Tuesday, September 24, 2013 1:18 PM
To: 'ProFox Email List'
Subject: RE: php date function
Here is some code I use for changing video's each day
Should be self explanatory, but if not, give me a shout
<?php
//Give what day of the week it is. Returns Sunday through Saturday.
$day = date("l");
if ($day == "Monday")
{
// Clint Eastwood
echo '<iframe width="510" height="315"
src="http://www.youtube.com/embed/tFAiqxm1FDA" frameborder="0"
allowfullscreen></iframe>';
// Gomer Pyle
echo '<iframe width="510" height="315"
src="http://www.youtube.com/embed/r5KeGccP9Jk?feature=player_embedded"
frameborder="0" allowfullscreen></iframe>';
}
elseif ($day == "Tuesday")
{
// College Girl
echo '<iframe width="510" height="315"
src="http://www.youtube.com/embed/j6iqTHJHW5o?feature=player_embedded"
frameborder="0" allowfullscreen></iframe>';
// Clint Eastwood
echo '<iframe width="510" height="315"
src="http://www.youtube.com/embed/tFAiqxm1FDA" frameborder="0"
allowfullscreen></iframe>';
}
elseif ($day == "Wednesday")
{
echo '<iframe width="510" height="315"
src="http://www.youtube.com/embed/r5KeGccP9Jk?feature=player_embedded"
frameborder="0" allowfullscreen></iframe>';
echo '<iframe width="510" height="315"
src="http://www.youtube.com/embed/tFAiqxm1FDA" frameborder="0"
allowfullscreen></iframe>';
}
elseif ($day == "Thursday")
{
echo '<iframe width="510" height="315"
src="http://www.youtube.com/embed/r5KeGccP9Jk?feature=player_embedded"
frameborder="0" allowfullscreen></iframe>';
echo '<iframe width="510" height="315"
src="http://www.youtube.com/embed/tFAiqxm1FDA" frameborder="0"
allowfullscreen></iframe>';
}
elseif ($day == "Friday")
{
echo '<iframe width="510" height="315"
src="http://www.youtube.com/embed/r5KeGccP9Jk?feature=player_embedded"
frameborder="0" allowfullscreen></iframe>';
echo '<iframe width="510" height="315"
src="http://www.youtube.com/embed/tFAiqxm1FDA" frameborder="0"
allowfullscreen></iframe>';
}
elseif ($day == "Saturday")
{
echo '<iframe width="510" height="315"
src="http://www.youtube.com/embed/r5KeGccP9Jk?feature=player_embedded"
frameborder="0" allowfullscreen></iframe>';
echo '<iframe width="510" height="315"
src="http://www.youtube.com/embed/tFAiqxm1FDA" frameborder="0"
allowfullscreen></iframe>';
}
elseif ($day == "Sunday")
{
echo '<iframe width="510" height="315"
src="http://www.youtube.com/embed/r5KeGccP9Jk?feature=player_embedded"
frameborder="0" allowfullscreen></iframe>';
echo '<iframe width="510" height="315"
src="http://www.youtube.com/embed/1sJl5OC7LCU?feature=player_embedded"
frameborder="0" allowfullscreen></iframe>';
}
?>
-----Original Message-----
From: ProFox [mailto:profox-bounces@leafe.com] On Behalf Of Gary Jeurink
Sent: Tuesday, September 24, 2013 1:09 PM
To: 'ProFox Email List'
Subject: php date function
Could somebody get me started on a PHP switch or IF ELSE function to set the
current week of a football season. Right now I am setting the date manually
each week with the following:
<?php
// function TO GET curweek of football season
function getCurWeek() {
$curWeek = '05';
return $curWeek;
} // end of getCurWeek
?>
Ideally I want to test the current date if it's between the start and end
date of each week. The wrinkle is and I need to adjust somehow, the pro
season is 1-week behind the college season and anything past curweek['15']
will be 'PS' post season for college and past curweek['17'] for pro's will
be 'PS' if you follow. I'll probably have to return two values instead of
the 1 that I'm doing now. I tried several and my php date syntax doesn't
work.
Gary Jeurink
--- StripMime Report -- processed MIME parts --- multipart/alternative
text/plain (text body -- kept)
text/html
---
[excessive quoting removed by server]
_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/0A033DED2F76486BAFC2D377C62433C9@OwnerPC
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
I think I'm close but I'm getting flagged when I create my switch variables.
$curDate = Date('Y/m/d');
$firstDate = DateTime::createFromFormat('Y/m/d', '2013/08/27');
$secondDate = DateTime::createFromFormat('Y/m/d', '2013/09/02');
if ($curDate >= $firstDate && $curDate <= $secondDate)
{
$curWeek = '01';
return $curWeek;
} // end of if week 1
The curDate goes through alright but the firstDate AND secondDate part won't
fly. I'm not sure if it's a version problem or the fact that I'm ignoring
the time portion.
Gary Jeurink
_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/B7735F72E2344A4C93CA7A2556B6FDF0@OwnerPC
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
You're probably trying to do it in too few steps..
$firstdate = date_date_set($date,2013,08,27);
$seconddate = date_date_set($date,2013,09,02);
-----Original Message-----
From: ProFox [mailto:profox-bounces@leafe.com] On Behalf Of Gary Jeurink
Sent: Sunday, September 29, 2013 12:02 PM
To: 'ProFox Email List'
Subject: RE: php date function
I think I'm close but I'm getting flagged when I create my switch variables.
$curDate = Date('Y/m/d');
$firstDate = DateTime::createFromFormat('Y/m/d', '2013/08/27');
$secondDate = DateTime::createFromFormat('Y/m/d', '2013/09/02');
if ($curDate >= $firstDate && $curDate <= $secondDate)
{
$curWeek = '01';
return $curWeek;
} // end of if week 1
The curDate goes through alright but the firstDate AND secondDate part won't
fly. I'm not sure if it's a version problem or the fact that I'm ignoring
the time portion.
Gary Jeurink
[excessive quoting removed by server]
_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/01fc01cebd36$4c040aa0$e40c1fe0$@gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.