Re: Calendar Date Help

From: Date: Wed, 28 May 2008 20:05:09 +0000
Subject: Re: Calendar Date Help
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-274782@lists.php.net to get a copy of this message
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)

« previous php.general (#274782) next »