I am having a form for scheduling a meeting request. and now i need to add timezones to it.
I have two dropdowns one for timezone and one for time. so if i select timezone as (GMT-11:00) Midway Island, Samoa and time as 4:00 PM than a mail goes to one person with the meeting request in his outlook.
now his outlook is configured with IST but as the timezone seleceted is new timezone so it should be adjusted appropriatedly.
$ical = 'BEGIN:VCALENDAR
PRODID:-//Microsoft Corporation//Outlook 11.0 MIMEDIR//EN
VERSION:2.0
METHOD:REQUEST
BEGIN:VEVENT
ORGANIZER:MAILTO:'.$from_address.'
ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;
CN='.$to.':mailto:'.$to.'
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';
i have searched on it.. and it says that i have to add VTIMEZONE, TZID, TZOFFSETFROM, TZOFFSETTO
now i am not getting the meaning of TZOFFSETFROM, TZOFFSETTO…? and how to use these to execute the task
Note that whatever
TZIDyou pick (they’re free format), they should have a matching entry in theVTIMEZONEsection of the configuration. Contrary to what @anmari said, theVTIMEZONEsection is required for the calendar event to be recognized by Outlook etc (showing accept/decline buttons).In my experience, the smartest approach is to take (copy/paste from mail source) an existing
VTIMEZONEconfiguration. This is the one for Western Europe, for example:Don’t change anything – just copy/paste this into your email code. Now, internally we use a PHP time zone matching this one, for instance “Europe/Amsterdam”. We use this as a base time zone, and convert the
VEVENT‘s values to it using PHP’sDateTimeclass.When sending this out, the receiving calendar/email client will automatically convert the incoming time data to the recipient’s time zone. Yay! 🙂