icalendar - ical event from php starting at 08:00 regardless of argument -



icalendar - ical event from php starting at 08:00 regardless of argument -

i using php send ics calendar invite using great function:

function sendicalemail($firstname,$lastname,$email,$meeting_date,$meeting_name,$meeting_duration,$address,$details) { $from_name = "jason"; $from_address = "abc@email.com"; $subject = "showing"; //doubles email subject , meeting subject in calendar $meeting_description = $details; $meeting_location = $address; //where meeting take place $message=''; //convert mysql datetime , build ical start, end , issue dates $meetingstamp = strtotime($meeting_date . " utc"); $dtstart= gmdate("ymd\this\z",$meetingstamp); $dtend= gmdate("ymd\this\z",$meetingstamp+$meeting_duration); $todaystamp = gmdate("ymd\this\z"); echo 'start:'.$dtstart.'<br><br>'; echo 'end:'.$dtend.'<br><br>'; //create unique identifier $cal_uid = date('ymd').'t'.date('his')."-".rand()."@mydomain.com"; //create mime boundry $mime_boundary = "----meeting booking----".md5(time()); //create email headers $headers = "from: ".$from_name." <".$from_address.">\n"; $headers .= "reply-to: ".$from_name." <".$from_address.">\n"; $headers .= "mime-version: 1.0\n"; $headers .= "content-type: multipart/alternative; boundary=\"$mime_boundary\"\n"; $headers .= "content-class: urn:content-classes:calendarmessage\n"; //create email body (html) $message .= "--$mime_boundary\n"; $message .= "content-type: text/html; charset=utf-8\n"; $message .= "content-transfer-encoding: 8bit\n\n"; $message .= "<html>\n"; $message .= "<body>\n"; //$message .= '<p>dear '.$firstname.' '.$lastname.',</p>'; //$message .= '<p>here html email / used meeting description</p>'; $message .= "</body>\n"; $message .= "</html>\n"; $message .= "--$mime_boundary\n"; //create ical content (google rfc 2445 details , examples of usage) $ical = 'begin:vcalendar prodid:-//microsoft corporation//outlook 11.0 mimedir//en version:2.0 method:publish begin:vevent organizer:mailto:'.$from_address.' dtstart:'.$dtstart.' dtend:'.$dtend.' location:'.$meeting_location.' transp:opaque sequence:0 uid:'.$cal_uid.' dtstamp:'.$todaystamp.' description:'.$meeting_description.' summary:'.$subject.' priority:5 class:public end:vevent end:vcalendar'; $message .= 'content-type: text/calendar;name="meeting.ics";method=request\n'; $message .= "content-transfer-encoding: 8bit\n\n"; $message .= $ical; //send mail service $mail_sent = @mail( $email, $subject, $message, $headers ); if($mail_sent) { homecoming true; } else { homecoming false; } }

on phone see next date/time:

thursday oct 9, 2014

from 08:00 09:00

from 12:00 13:00 (gmt)

where , arguments following:

start:20141009t120000z end:20141009t130000z

so me 08:00 , 09:00 unexpected. maybe missing something.

what timezone? program, probably, shows original time in utc/gmt (letter z - zulu in timestamp) , adds time in timezone. 12:00 - 13:00 utc same 8:00 - 9:00 et daylight. setup right timezone in start , end times.

php icalendar

Comments

Popular posts from this blog

c# - ASP.NET MVC Sequence contains no matching element -

java - Parsing XML, skip certain tags -

rest - How to invalidate user session on inactivity in a stateless server? -