On Fri, Oct 25, 2013 at 6:49 PM, Gary Jeurink <[email protected]> wrote:

> Thanks for your reply but the
> False = 0 / N / .F.
> True = 1 / Y / .T.
> .. is over my head is that associate array?
>
> My biggest block today is how to set the value of a date variable without a
> syntax error in PHP
>
> function getCurWeek() {
>    $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;
>     }
> First and second date won't fly
>
> Gary Jeurink
>

You are so close! createFromFormat says to use the format string you
specify: 'Y/m/d' to parse the string '2013-08-27' - the Y, m and d are
special character placeholders that specify 4-digit-year, month and day.
The slashes are 'literal characters' that says there are slashes in the
string to ignore.

So, change the dashes in your string to slashes. Or change the slashes in
your format string to dashes.



-- 
Ted Roche
Ted Roche & Associates, LLC
http://www.tedroche.com


--- StripMime Report -- processed MIME parts ---
multipart/alternative
  text/plain (text body -- kept)
  text/html
---

_______________________________________________
Post Messages to: [email protected]
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/cacw6n4vaac6x1fkb0m4kxgy8zkknn07hw6hpfs_zeyokuwa...@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.

Reply via email to