By avior on
Hello
I have wrote a small module to automating and manage past events
the admin can choose to delete / unsticky / unpromote / unpublish an event that past (cron hook)
is there another (a better way) doing this ?
anyway (even for academic reasons) I'll be happy to understand what is the correct way to do the query of the past events, this is my code :
$curtime = time();
$closing_time = $curtime - variable_get('date_default_timezone', 0);
$result = db_query("SELECT e.nid FROM {event} e inner join {node} n on e.nid = n.nid where n.status =1 AND e.event_end < %d", $closing_time);
my guess that it's not that simple , parameters i had in mind are :
1. the machine time & timezone (hoster on other tz than my local tz)
2. site timezone
3. the event timezone (i have set all events to the site tz)
how to i use machine timezone ?, what about the event time zone ?
Thanks Avior