Re: Calendar Date Help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Robert Cummings wrote:
function getStamp($dateStr,$dayVal=1){
   return date('U',mktime(0,0,0, $dateStr,$dayVal,date('Y')));
}
                                                    ^^^^^^^^^
                                                    ^^^^^^^^^
                                                    ^^^^^^^^^
Similarly.

Cheers,
Rob.

Hi Rob,

Changing:
function setCal($h=0,$m=0,$s=0,$offset,$dayVal=1){		
   $stamp = date('U',mktime($h,$m,$s, $offset,$dayVal,date('Y')));

To:
function setCal($h=0,$m=0,$s=0,$offset,$dayVal=1){
  if (date('Y') > date('Y',date('U',mktime($h,$m,$s,
     $offset,$dayVal,date('Y')))))
  {
     $stamp = date('U',mktime($h,$m,$s, $offset,$dayVal,date('Y')+1));
  }
  else
  {
     $stamp = date('U',mktime($h,$m,$s, $offset,$dayVal,date('Y')));
  }

Makes no change. Strange condition still exists. I was rather hoping
that if "date('U',mktime($h,$m,$s, $offset,$dayVal,date('Y')))"
is smart enough to know to increase or decrease the month value that it
would do the same to the year value accordingly.

$offset contain either date('n',$timestamp)-1  or  date('n',$timestamp)+1

The $timestamp value comes from the array being stored in the
$_SESSION['calendar'] as either 'current', 'prev', or 'next'.

--

Mark
-------------------------
the rule of law is good, however the rule of tyrants just plain sucks!
Real Tax Reform begins with getting rid of the IRS.
==============================================
Powered by CentOS5 (RHEL5)


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux