php-general Digest 29 Dec 2011 21:30:27 -0000 Issue 7628

Topics (messages 316122 through 316124):

Onion PEAR Packager 0.0.11 Released
        316122 by: Lin Yo-An

Re: [php] static html search engine for php static html site
        316123 by: Tamara Temple

Question about date calculations
        316124 by: Eric Lommatsch

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
Hi folks,

Onion 0.0.11 has been released, a bundle feature is included.

You can use Onion to build your PEAR package very very easily through a
package.ini meta config file.

Through that, you can also install the PEAR package dependencies into local
directory

So the package can be bundled easily, and can be compiled into a phar file
(through onion "compile" command") with a built-in PSR-0 classloader.

Blog post:
http://c9s.blogspot.com/2011/12/announcing-onion-bundle-feature.html

Onion is hosted on GitHub
http://github.com/c9s/Onion

You can download a standalone onion executable here:

curl https://github.com/c9s/Onion/raw/master/onion.phar > ~/bin/onion.phar

Run onion.phar to see the available commands:

      $  php onion.phar


-- 
Best Regards,

Yo-An Lin (c9s)

--- End Message ---
--- Begin Message ---
Ashley Sheridan <a...@ashleysheridan.co.uk> wrote:
> Please don't top post.

Wonder if said poster understands what that means....

--- End Message ---
--- Begin Message ---
Hello List,

 

I am using PHP version 5.2.6.

 

I have a page I am trying to create where I am comparing the values of two
MySQL date fields with the current date. One of the MySQL Date fields is a
class start date, the other is the class end date.

 

First I need to calculate the number of days between class start and end
date. Then based on the number of days between these to dates I have to find
out how close the current date is to the class end date.

 

So far in looking at the functions that are available at
http://www.php.net/manual/en/ref.datetime.php I have not been able to figure
out how to do what I need to do.  Below is a snippet showing approximately
what I am trying to do.

 

<?PHP

...

  $dteStartDate[$intCnt]= New DateTime($row[10]);

  $dteEndDate[$intCnt]= New DateTime($row[11]);

...

  $dteCheckDate=date('Y-m-d');

  $intDayCnt=$dteEndDate[$i]-$dteStartDate[$i];

  if (($dteCheckDate>=($dteEndDate[$i]-7) &&
$dteCheckDate<=($dteEndDate[$i]+1)) && $intDayCnt<16)

...

?>

 

My start date is 12/26/2011, the end date 1/8/2012 so the value for
&intDayCnt should be 13, but it is coming up as 0.

 

Also the check date which is 12/29/2011 is being calculated as after my end
date.  Can someone point me in the direction of what I need to do to have
the comparisons I am doing work.

 

Eric Lommatsch. 


--- End Message ---

Reply via email to