code:<%$startTime = Time::Local::timegm(0, 0, 0, 1, $MONTH, $YEAR-1900);$endTime = Time::Local::timegm(0, 0, 0, 1, $MONTH, $YEAR-1899) ;&getEvents( {'start'=>$startTime, 'end'=>$endTime});%>
<%$startTime = Time::Local::timegm(0, 0, 0, 1, $MONTH, $YEAR-1900);$endTime = Time::Local::timegm(0, 0, 0, 1, $MONTH, $YEAR-1899) ;&getEvents( {'start'=>$startTime, 'end'=>$endTime});%>
I tried many variations of -/+ 1 and using an if $MONTH > 11 ( i even tried if $MONTH > 12) ...the only way I could keep the list view from errors is to use this code
code:<%$startTime = Time::Local::timegm(0, 0, 0, 1, $MONTH-1, $YEAR-1900);$endTime = Time::Local::timegm(0, 0, 0, 1, $MONTH-1, $YEAR-1899) ;&getEvents( {'start'=>$startTime, 'end'=>$endTime});%>
<%$startTime = Time::Local::timegm(0, 0, 0, 1, $MONTH-1, $YEAR-1900);$endTime = Time::Local::timegm(0, 0, 0, 1, $MONTH-1, $YEAR-1899) ;&getEvents( {'start'=>$startTime, 'end'=>$endTime});%>
any help??thanks
Well since $YEAR-1900 will equate to this year, it is unlikely to retrieve events from next year using it. You'll likely have to do something about what year you're specifying to retrieve events from.
You'll also likely have to do something different with the $MONTH variable as I do not believe you can just add 1 to December to get January.
Dan O.
[This message has been edited by DanO (edited December 05, 2003).]
code:$startTime = Time::Local::timegm(0, 0, 0, 1, $MONTH-12, $YEAR-1899);$endTime = Time::Local::timegm(0, 0, 0, 1, $MONTH-1, $YEAR-1899) ;&getEvents( {'start'=>$startTime, 'end'=>$endTime});
$startTime = Time::Local::timegm(0, 0, 0, 1, $MONTH-12, $YEAR-1899);$endTime = Time::Local::timegm(0, 0, 0, 1, $MONTH-1, $YEAR-1899) ;&getEvents( {'start'=>$startTime, 'end'=>$endTime});
------------------
[This message has been edited by Alvy (edited December 05, 2003).]
That's not a string but 4 separate values being passed to the Time::Local::timegm function (along with the rest). I believe they represent 0 seconds, 0 minutes, 0 hours, 1st day of the month.
** Why does $MONTH give me next month? **
From the documentation under "Defined Variables":
$MONTH - The month number of the currently displayed date.
** Why does is it -12, should it not be -11 since the months are 0-11? **
You'd have to look at the way the Time::Local::timegm function uses the values you're passing it. I really don't know.
code:<%$startTime = Time::Local::timegm(0, 0, 0, 1, $MONTH, $YEAR-1900);$endTime = Time::Local::timegm(0, 0, 0, 1, $MONTH, $YEAR-1899) ;if $MONTH > 12{$startTime = Time::Local::timegm(0, 0, 0, 1, $MONTH-12, $YEAR-1899);$endTime = Time::Local::timegm(0, 0, 0, 1, $MONTH-1, $YEAR-1899) ;}&getEvents( {'start'=>$startTime, 'end'=>$endTime});%>
<%$startTime = Time::Local::timegm(0, 0, 0, 1, $MONTH, $YEAR-1900);$endTime = Time::Local::timegm(0, 0, 0, 1, $MONTH, $YEAR-1899) ;if $MONTH > 12{$startTime = Time::Local::timegm(0, 0, 0, 1, $MONTH-12, $YEAR-1899);$endTime = Time::Local::timegm(0, 0, 0, 1, $MONTH-1, $YEAR-1899) ;}&getEvents( {'start'=>$startTime, 'end'=>$endTime});%>
Or something like that to account for the 12th month?
I know I prolly have some errors in that...
quote:** Why does $MONTH give me next month? **From the documentation under "Defined Variables":$MONTH - The month number of the currently displayed date.
JFYI $MONTH will never be greater than 12. It would need to be 13 to satisfy that if clause and as is, would never execute.
** I think it may be that $MONTH represents the number of the month as shown in a date... 1-12 **
I believe so.