datetime - Right time format of using timeMax retrieving Google Calendar Events in PHP? -


i trying retrieve google calendar events using php analysing purposes. used singleevents= true settings expand recurring events single instances. in order avoid retrieving unlimited recurring events, tried set event start upper bound 2015-06-01.

here code using:

$eventlist = $cal->events->listevents($tempcal["id"], array(maxresults   =>5000,singleevents => true,timemax => '2015-06-01t00:00:00-04:00')); 

but seems timemax parameter not work.

i tried other time format '2015-06-01t00:00:00z' , not work either.

however, tried same string using web browser , retrieved events before 2015-06-01 using https://developers.google.com/google-apps/calendar/v3/reference/events/list

what wrong timemax format?

the solution worked me (ordering , time-bounds):

/* retrieve events today */ $start = date(datetime::atom, mktime(0,0,0,date('m'), date('d'), date('y'))); $end = date(datetime::atom, mktime(23,59,59,date('m'), date('d'), date('y')));  $eventoptions = array("orderby"=>"starttime",                       "singleevents"=>true,                       "timemin"=>$start,                       "timemax"=>$end); $events = $service->events->listevents($calendar_id, $eventoptions); 

Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -