vCalendar code showing wrong time

G

GJH

Hi,
I have created a page that downloads a vCalendar to a visitor. If the person
logs on from somewhere other than EST their times are incorrect.
for example, someone in Colorado accesses the page that is hosted in NYC.
The time in the vCalendar should be for 4pm to 6pm but the person from
Colorado is getting 2 hours behind 2pm to 4pm. Is there a way to NOT have
the time shift. Yes, I realize Colorado is 2 hours behind NYC, but shouldnt
the time be dependant upon whose computer the vCalendar is saved on?

here is my code:

Sub Page_Load(Sender As Object, E As EventArgs)

'PARAMETERS
Dim beginDate as Date = #01/07/2005 4:00 PM#

Dim endDate as Date = #01/07/2005 6:00 PM#
Dim myLocation as String = "Computer Room"
Dim mySubject as String = "Training"
Dim myDescription as String = "Event details"
'INITIALIZATION
Dim mStream As new MemoryStream()
Dim writer As new StreamWriter(mStream)
writer.AutoFlush = true
'HEADER
writer.WriteLine("BEGIN:VCALENDAR")
writer.WriteLine("PRODID:-//Flo Inc.//FloSoft//EN")
writer.WriteLine("BEGIN:VEVENT")
'BODY
writer.WriteLine("DTSTART:" & _
beginDate.ToUniversalTime.ToString("yyyyMMdd\THHmmss\Z") )
writer.WriteLine("DTEND:" & _
endDate.ToUniversalTime.ToString("yyyyMMdd\THHmmss\Z") )
writer.WriteLine("LOCATION:" & myLocation)
writer.WriteLine("DESCRIPTION;ENCODING=QUOTED-PRINTABLE:" &
myDescription)
writer.WriteLine("SUMMARY:" & mySubject)
'FOOTER
writer.WriteLine("PRIORITY:3")
writer.WriteLine("END:VEVENT")
writer.WriteLine("END:VCALENDAR")
'MAKE IT DOWNLOADABLE
Response.Clear() 'clears the current output content from the buffer
Response.AppendHeader("Content-Disposition", _
"attachment; filename=Add2Calendar.vcs")
Response.AppendHeader("Content-Length", mStream.Length.ToString())
Response.ContentType = "application/download"
Response.BinaryWrite(mStream.ToArray())
Response.End()
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top