• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 498
  • Last Modified:

Help - .ICS attachment is 10 hours off

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

  • 3
  • 3
1 Solution
Brian GeeCommented:
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.
OGSanAuthor Commented:
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?
Brian GeeCommented:
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.
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

OGSanAuthor Commented:
Right on!  I can see EXACTLY what I was doing wrong here.  Thanks, yobri!
Brian GeeCommented:
Glad to have been of help, OGSan.
OGSanAuthor Commented:
I just finished tweaking my code and it's working just fine, now, yobri!  Thanks again!

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now