/    Sign up×
Community /Pin to ProfileBookmark

Creating an ics file and time off by 4 hours

Here is my code and even though I set my timezone (eastern standard time and eastern daylight time) the calendar event is off by 4 hours – so i want the event to start at 9 am and end at 5 pm and I had to set it 4 hours ahead

[CODE]
echo “DTSTART:{$date}T130000Zn”;
echo “DTEND:{$date}T210000Zn”;
[/CODE]

full code

[CODE]
header(“Content-Type: text/Calendar; charset=utf-8”);
header(“Content-Disposition: inline; filename=cpso{$date}.ics”);
echo “BEGIN:VCALENDARn”;
echo “PRODID:-//Microsoft Corporation//Outlook 14.0 MIMEDIR//ENn”;
echo “VERSION:2.0n”;
echo “METHOD:EVENTn”;
echo “X-MS-OLK-FORCEINSPECTOROPEN:TRUEn”;
echo “BEGIN:VEVENTn”;
echo “CLASS:PUBLICn”;

//set daylight saving time every year
echo “BEGIN:VTIMEZONEn”;
echo “TZID:America/Toronton”;
echo “LAST-MODIFIED:20130314T111700Zn”;
echo “BEGIN:DAYLIGHTn”;
echo “DTSTART:20130310T020000n”;
echo “TZOFFSETTO:-0700n”;
echo “TZOFFSETFROM:+0000n”;
echo “TZNAME:ESTn”;
echo “END:DAYLIGHTn”;
echo “BEGIN:STANDARDn”;
echo “DTSTART:20131103T020000n”;
echo “TZOFFSETTO:-0800n”;
echo “TZOFFSETFROM:-0700n”;
echo “TZNAME:ESTn”;
echo “END:STANDARDn”;
echo “END:VTIMEZONEn”;

echo “CREATED:{$date}T000000Zn”;
echo “DESCRIPTION:Discipline/Fitness Hearing for {$physician}n”;
echo “DTSTAMP:{$date}T000000Zn”;
echo “DTSTART:{$date}T130000Zn”;
echo “DTEND:{$date}T210000Zn”;
echo “LAST-MODIFIED:{$date}T101015Zn”;
echo “LOCATION:College of Physicians and Surgeonsn”;
echo “PRIORITY:5n”;
echo “SEQUENCE:0n”;
echo “SUMMARY;LANGUAGE=en-us:CPSO Discipline/Fitness Hearingn”;
echo “TRANSP:OPAQUEn”;
echo “UID:”.date(‘Ymd’).’T’.date(‘His’).”-“.rand().”-CPSO\n”;
echo “X-MICROSOFT-CDO-BUSYSTATUS:BUSYn”;
echo “X-MICROSOFT-CDO-IMPORTANCE:1n”;
echo “X-MICROSOFT-CDO-ALLDAYEVENT:TRUEn”;
echo “X-MICROSOFT-MSNCALENDAR-ALLDAYEVENT:TRUEn”;
echo “X-MICROSOFT-DISALLOW-COUNTER:FALSEn”;
echo “X-MS-OLK-ALLOWEXTERNCHECK:TRUEn”;
echo “X-MS-OLK-AUTOFILLLOCATION:FALSEn”;
echo “X-MS-OLK-CONFTYPE:0n”;
//Here is to set the reminder for the event.
echo “BEGIN:VALARMn”;
echo “TRIGGER:-PT1440Mn”;
echo “ACTION:DISPLAYn”;
echo “DESCRIPTION:Remindern”;
echo “END:VALARMn”;
echo “END:VEVENTn”;
echo “END:VCALENDARn”;
[/CODE]

to post a comment
PHP

0Be the first to comment 😎

×

Success!

Help @beylah spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...