Help - .ICS attachment is 10 hours off

Posted on 2011-05-12
Last Modified: 2012-05-11
I'm using the code below to format an .ics attachment sent out from my ASP program.  The email gets sent out - but it's always 10 hours earlier than the actual beginning/ending time.  I don't have any control over the server's system date/time settings - so I'm afraid I have to try and account for the 10 hour offset in my code.  Unless there's another way...?  Can an Expert help me out with this problem, please?  TIA!
' 	Write the iCalendar file to the file system.
	file.WriteLine "BEGIN:VCALENDAR"
	file.WriteLine "PRODID:-//ASP iCalendar Test//My ASP App V1.0//EN"
	file.WriteLine "VERSION:2.0"
	file.WriteLine "METHOD:REQUEST"
	file.WriteLine "BEGIN:VEVENT"
	file.WriteLine "ORGANIZER:MAILTO:" & strFrom
	file.WriteLine "DTSTART:" & FormatDateTime(startDate)
	file.WriteLine "DTEND:" & FormatDateTime(endDate)
	file.WriteLine "LOCATION: " & strLoc
	file.WriteLine "TRANSP:OPAQUE"
	file.WriteLine "SEQUENCE:0"
	file.WriteLine "UID:" & uniqueID
	file.WriteLine "DTSTAMP:" & FormatDateTime(Now())
	file.WriteLine "DESCRIPTION:" & strCourse
	file.WriteLine "SUMMARY:" & strCourse
	file.WriteLine "PRIORITY:5"
	file.WriteLine "CLASS:PUBLIC"
	file.WriteLine "BEGIN:VALARM"
	file.WriteLine "TRIGGER:-PT15M"
	file.WriteLine "ACTION:DISPLAY"
	file.WriteLine "END:VALARM"
	file.WriteLine "END:VEVENT"
	file.WriteLine "END:VCALENDAR"

Open in new window

Question by:OGSan
    LVL 23

    Expert Comment

    by:Brian Gee
    You'll have to code to include for Hawaii Standard Time here. Right now, without it being designated, it appears that the times will default to GMT which is 10 hours ahead of Hawaii time.
    LVL 1

    Author Comment

    Is that done with the TZID parameter?  Sorry - this is the first attempt at creating an ics attachment.  I don't know what the correct format/syntax is.  Can you assist, please?
    LVL 23

    Accepted Solution

    Right, TZ. You'll know how to more accurately get the output you need by creating a meeting in your Outlook Calendar. Open it up, and then Save As into ICS format. Then drag the ICS file into Notepad and see how TZ is being employed so you can incorporate it to fit with Hawaii Standard Time and your file.WriteLine code process accordingly.
    LVL 1

    Author Closing Comment

    Right on!  I can see EXACTLY what I was doing wrong here.  Thanks, yobri!
    LVL 23

    Expert Comment

    by:Brian Gee
    Glad to have been of help, OGSan.
    LVL 1

    Author Comment

    I just finished tweaking my code and it's working just fine, now, yobri!  Thanks again!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Suggested Solutions

    Outlook can send email in three different formats: HTML, Rich Text, and Plain Text. Rich Text format is problematic though as it automatically wraps all formatting into an attachment called Winmail.dat. It also tends to pack actual file attachments …
    Sorry for my English and Italian screenshots..... Problem: Every Year the number of E-Mails grow dramatically and the space that they take on Exchange Servers or .PST files, grow much more faster, once it was only text, now our E-Mail Archives …
    Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
    This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now