Time incorrect when running this script (exporting .vcs file)
--____KXJCTNHTBQGOSBEWUGCS____
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
I am allowing users to save a .vcs file for an event coming from a =
database. Everything works correctly except it is showing the incorrect =
time. Does anyone have any clues on how to get this to show the time =
correctly, everything else is great!
------------------------- script begin -------------------------
strvCalendar =3D BuildVCalendar()
'Sends save to browser as vcs file
Response.ContentType =3D "text/x-vCalendar"
Response.AddHeader "Content-Disposition", _
"filename=3DEvent" & ".vcs;"
Response.Write strvCalendar
Response.End
Function BuildVCalendar()
Dim dtStart, dtEnd, strSubject, strLocation, strDesc ' well assume these =
come from a database
' -- Assuming Event_Begin_Date and Event_End_Date hold
' -- Date and Time values
dtStart =3D "20060321T233000Z"
dtEnd =3D "20060323T233000Z"
' --
strEventID =3D "203482"
strSubject =3D "Test Event"
strLocation =3D "Columbus, Ohio 43211"
strDesc =3D "This is a test description"
BuildVCalendar =3D "BEGIN:VCALENDAR" & vbCrlf &_
"VERSION:1.0" & vbCrlf &_
"BEGIN: VEVENT" & vbCrlf &_
"DTSTART:" & dtStart & vbCrlf &_
"DTEND:" & dtEnd & vbCrlf &_
"SUMMARY;ENCODING=3DQUOTED-PRINTABLE:" & strSubject & vbCrlf &_
"DESCRIPTION;ENCODING=3DQUOTED-PRINTABLE:" & strDesc & vbCrlf &_
"LOCATION;ENCODING=3DQUOTED-PRINTABLE:" & strLocation & vbCrlf &_
"UID:" & strEventID & dtStart & strSubject & vbCrlf &_
"PRIORITY:3" & vbCrlf &_
"END:VEVENT" & vbCrlf &_
"END:VCALENDAR" & vbCrlf
End Function
------------------------- script end -------------------------
--____KXJCTNHTBQGOSBEWUGCS____
Content-Type: multipart/related; boundary="____LCRUJIMHIPVJXLFNRMNM____"
--____LCRUJIMHIPVJXLFNRMNM____
Content-Type: text/html; charset=windows-1252
Content-Transfer-Encoding: quoted-printable
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; charset=3Diso-8859-1"=
>
<META content=3D"MSHTML 6.00.2900.2802" name=3DGENERATOR></HEAD>
<BODY style=3D"MARGIN: 4px 4px 1px; FONT: 10pt Tahoma">
<DIV>I am allowing users to save a .vcs file for an event coming from a =
database. Everything works correctly except it is showing the =
incorrect time. Does anyone have any clues on how to get this to =
show the time correctly, everything else is great!</DIV>
<DIV> </DIV>
<DIV>------------------------- script begin ------------------------- =
</DIV>
<DIV>strvCalendar =3D BuildVCalendar()</DIV>
<DIV> </DIV>
<DIV>'Sends save to browser as vcs file<BR>Response.ContentType =3D =
"text/x-vCalendar"<BR> Response.AddHeader "Content-Disposition", =
_<BR> "filename=3DEvent" & ".vcs;"<BR> Response.Write =
strvCalendar<BR> Response.End</DIV>
<DIV> </DIV>
<DIV>Function BuildVCalendar()</DIV>
<DIV> </DIV>
<DIV> Dim dtStart, dtEnd, strSubject, strLocation, strDesc ' well =
assume these come from a database<BR> <BR> ' -- Assuming =
Event_Begin_Date and Event_End_Date hold<BR> ' -- Date and Time =
values</DIV>
<DIV> </DIV>
<DIV> dtStart =3D "20060321T233000Z"<BR> dtEnd =3D "20060323T2330=
00Z"<BR> ' -- <BR> strEventID =3D "203482"<BR> strSubject =
=3D "Test Event"<BR> strLocation =3D "Columbus, Ohio 43211"<BR> s=
trDesc =3D "This is a test description" <BR> <BR> BuildVCale=
ndar =3D "BEGIN:VCALENDAR" & vbCrlf &_<BR> "VERSION:1.0" =
& vbCrlf &_<BR> "BEGIN: VEVENT" & vbCrlf &_<BR> "=
DTSTART:" & dtStart & vbCrlf &_<BR> "DTEND:" & =
dtEnd & vbCrlf &_<BR> "SUMMARY;ENCODING=3DQUOTED-PRINTAB=
LE:" & strSubject & vbCrlf &_<BR> "DESCRIPTION;ENCODING=3D=
QUOTED-PRINTABLE:" & strDesc & vbCrlf &_<BR> "LOCATION;ENC=
ODING=3DQUOTED-PRINTABLE:" & strLocation & vbCrlf &_<BR> "=
UID:" & strEventID & dtStart & strSubject & vbCrlf =
&_<BR> "PRIORITY:3" & vbCrlf &_<BR> "END:VEVENT" =
& vbCrlf &_<BR> "END:VCALENDAR" & vbCrlf</DIV>
<DIV> </DIV>
<DIV>End Function<BR>------------------------- script end =
------------------------- </DIV></BODY></HTML>
--____LCRUJIMHIPVJXLFNRMNM____--
--____KXJCTNHTBQGOSBEWUGCS____--
Re: Time incorrect when running this script (exporting .vcs file)
--____IPYWWLUUARCUWLVQEVMO____
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
The time shows up as 6:30 pm opposed 11:30 pm? Any clues?
>>> shawn [at] myemail.com<> 03/21/06 4:55 PM >>>
I am allowing users to save a .vcs file for an event coming from a =
database. Everything works correctly except it is showing the incorrect =
time. Does anyone have any clues on how to get this to show the time =
correctly, everything else is great!
------------------------- script begin -------------------------
strvCalendar =3D BuildVCalendar()
'Sends save to browser as vcs file
Response.ContentType =3D "text/x-vCalendar"
Response.AddHeader "Content-Disposition", _
"filename=3DEvent" & ".vcs;"
Response.Write strvCalendar
Response.End
Function BuildVCalendar()
Dim dtStart, dtEnd, strSubject, strLocation, strDesc ' well assume these =
come from a database
' -- Assuming Event_Begin_Date and Event_End_Date hold
' -- Date and Time values
dtStart =3D "20060321T233000Z"
dtEnd =3D "20060323T233000Z"
' --
strEventID =3D "203482"
strSubject =3D "Test Event"
strLocation =3D "Columbus, Ohio 43211"
strDesc =3D "This is a test description"
BuildVCalendar =3D "BEGIN:VCALENDAR" & vbCrlf &_
"VERSION:1.0" & vbCrlf &_
"BEGIN: VEVENT" & vbCrlf &_
"DTSTART:" & dtStart & vbCrlf &_
"DTEND:" & dtEnd & vbCrlf &_
"SUMMARY;ENCODING=3DQUOTED-PRINTABLE:" & strSubject & vbCrlf &_
"DESCRIPTION;ENCODING=3DQUOTED-PRINTABLE:" & strDesc & vbCrlf &_
"LOCATION;ENCODING=3DQUOTED-PRINTABLE:" & strLocation & vbCrlf &_
"UID:" & strEventID & dtStart & strSubject & vbCrlf &_
"PRIORITY:3" & vbCrlf &_
"END:VEVENT" & vbCrlf &_
"END:VCALENDAR" & vbCrlf
End Function
------------------------- script end -------------------------
--____IPYWWLUUARCUWLVQEVMO____
Content-Type: multipart/related; boundary="____OZLUNHAUXNMZMULGPSDC____"
--____OZLUNHAUXNMZMULGPSDC____
Content-Type: text/html; charset=windows-1252
Content-Transfer-Encoding: quoted-printable
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; charset=3Diso-8859-1"=
>
<META content=3D"MSHTML 6.00.2900.2802" name=3DGENERATOR></HEAD>
<BODY style=3D"MARGIN: 4px 4px 1px; FONT: 10pt Tahoma">The time shows up =
as 6:30 pm opposed 11:30 pm? Any clues? <BR><BR>>>> =
shawn [at] myemail.com<> 03/21/06 4:55 PM >>><BR>
<DIV style=3D"FONT: 10pt Tahoma; COLOR: #000000">
<DIV>I am allowing users to save a .vcs file for an event coming from a =
database. Everything works correctly except it is showing the =
incorrect time. Does anyone have any clues on how to get this to =
show the time correctly, everything else is great!</DIV>
<DIV> </DIV>
<DIV>------------------------- script begin ------------------------- =
</DIV>
<DIV>strvCalendar =3D BuildVCalendar()</DIV>
<DIV> </DIV>
<DIV>'Sends save to browser as vcs file<BR>Response.ContentType =3D =
"text/x-vCalendar"<BR> Response.AddHeader "Content-Disposition", =
_<BR> "filename=3DEvent" & ".vcs;"<BR> Response.Write =
strvCalendar<BR> Response.End</DIV>
<DIV> </DIV>
<DIV>Function BuildVCalendar()</DIV>
<DIV> </DIV>
<DIV> Dim dtStart, dtEnd, strSubject, strLocation, strDesc ' well =
assume these come from a database<BR> <BR> ' -- Assuming =
Event_Begin_Date and Event_End_Date hold<BR> ' -- Date and Time =
values</DIV>
<DIV> </DIV>
<DIV> dtStart =3D "20060321T233000Z"<BR> dtEnd =3D "20060323T2330=
00Z"<BR> ' -- <BR> strEventID =3D "203482"<BR> strSubject =
=3D "Test Event"<BR> strLocation =3D "Columbus, Ohio 43211"<BR> s=
trDesc =3D "This is a test description" <BR> <BR> BuildVCale=
ndar =3D "BEGIN:VCALENDAR" & vbCrlf &_<BR> "VERSION:1.0" =
& vbCrlf &_<BR> "BEGIN: VEVENT" & vbCrlf &_<BR> "=
DTSTART:" & dtStart & vbCrlf &_<BR> "DTEND:" & =
dtEnd & vbCrlf &_<BR> "SUMMARY;ENCODING=3DQUOTED-PRINTAB=
LE:" & strSubject & vbCrlf &_<BR> "DESCRIPTION;ENCODING=3D=
QUOTED-PRINTABLE:" & strDesc & vbCrlf &_<BR> "LOCATION;ENC=
ODING=3DQUOTED-PRINTABLE:" & strLocation & vbCrlf &_<BR> "=
UID:" & strEventID & dtStart & strSubject & vbCrlf =
&_<BR> "PRIORITY:3" & vbCrlf &_<BR> "END:VEVENT" =
& vbCrlf &_<BR> "END:VCALENDAR" & vbCrlf</DIV>
<DIV> </DIV>
<DIV>End Function<BR>------------------------- script end =
------------------------- </DIV></DIV></BODY></HTML>
--____OZLUNHAUXNMZMULGPSDC____--
--____IPYWWLUUARCUWLVQEVMO____--
Re: Time incorrect when running this script (exporting .vcs file)
This is a multi-part message in MIME format.
------=_NextPart_000_0013_01C64D02.E825E9F0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
"shawn [at] myemail.com" <SFergus2 [at] cscc.edu> wrote in message =
news:%23LIlsLTTGHA.1688 [at] TK2MSFTNGP11.phx.gbl...
The time shows up as 6:30 pm opposed 11:30 pm? Any clues?
Surely it's a time zone issue. You're where, in Ohio? Would your time =
zone happen to be UTC -5:00? Check the spec for .vcs, wouldn't be much =
of a surprise if it requires you to convert time of day to UTC... =
Indeed, saving an event as .vcs from Outlook confirms it, time needs to =
be converted to UTC.
To do it right, you need to execute script on the client, to determine =
and post the client's local time zone offset... much like this:
var dt =3D new Date();
document.forms[0].ClientTZ.value =3D dt.getTimezoneOffset();
(Which of course assumes that an input called ClientTZ has been defined =
in the first form object in the document.)
Armed with that value (which is expressed in minutes of offset from UTC) =
you can convert between a user's local time and UTC, and your code will =
work no matter what time zone the user happens to be in... as long as =
the client computer's time zone is correctly set, anyway.
-Mark.
>>> shawn [at] myemail.com<> 03/21/06 4:55 PM >>>
I am allowing users to save a .vcs file for an event coming from a =
database. Everything works correctly except it is showing the incorrect =
time. Does anyone have any clues on how to get this to show the time =
correctly, everything else is great!
------------------------- script begin -------------------------
strvCalendar =3D BuildVCalendar()
'Sends save to browser as vcs file
Response.ContentType =3D "text/x-vCalendar"
Response.AddHeader "Content-Disposition", _
"filename=3DEvent" & ".vcs;"
Response.Write strvCalendar
Response.End
Function BuildVCalendar()
Dim dtStart, dtEnd, strSubject, strLocation, strDesc ' well assume =
these come from a database
' -- Assuming Event_Begin_Date and Event_End_Date hold
' -- Date and Time values
dtStart =3D "20060321T233000Z"
dtEnd =3D "20060323T233000Z"
' --
strEventID =3D "203482"
strSubject =3D "Test Event"
strLocation =3D "Columbus, Ohio 43211"
strDesc =3D "This is a test description"
BuildVCalendar =3D "BEGIN:VCALENDAR" & vbCrlf &_
"VERSION:1.0" & vbCrlf &_
"BEGIN: VEVENT" & vbCrlf &_
"DTSTART:" & dtStart & vbCrlf &_
"DTEND:" & dtEnd & vbCrlf &_
"SUMMARY;ENCODING=3DQUOTED-PRINTABLE:" & strSubject & vbCrlf &_
"DESCRIPTION;ENCODING=3DQUOTED-PRINTABLE:" & strDesc & vbCrlf &_
"LOCATION;ENCODING=3DQUOTED-PRINTABLE:" & strLocation & vbCrlf &_
"UID:" & strEventID & dtStart & strSubject & vbCrlf &_
"PRIORITY:3" & vbCrlf &_
"END:VEVENT" & vbCrlf &_
"END:VCALENDAR" & vbCrlf
End Function
------------------------- script end -------------------------
------=_NextPart_000_0013_01C64D02.E825E9F0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2802" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY style=3D"MARGIN: 4px 4px 1px; FONT: 10pt Tahoma" =
bgColor=3D#ffffff>
<DIV><FONT face=3DArial></FONT> </DIV>
<BLOCKQUOTE dir=3Dltr
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"<A href=3D"mailto:shawn [at] myemail.com">shawn [at] myemail.com</A>" =
<<A
href=3D"mailto:SFergus2 [at] cscc.edu">SFergus2 [at] cscc.edu</A>> wrote in =
message <A
=
href=3D"news:%23LIlsLTTGHA.1688 [at] TK2MSFTNGP11.phx.gbl">news:% 23LIlsLTTGHA.=
1688 [at] TK2MSFTNGP11.phx.gbl</A>...</DIV>
<DIV>The time shows up as 6:30 pm opposed 11:30 pm? Any =
clues?
</DIV></BLOCKQUOTE>
<DIV dir=3Dltr><FONT face=3DArial>Surely it's a time zone =
issue. You're
where, in Ohio? Would your time zone happen to be UTC -5:00? =
Check
the spec for .vcs, wouldn't be much of a surprise if it requires you to =
convert
time of day to UTC... Indeed, saving an event as .vcs from Outlook =
confirms it, time needs to be converted to UTC.</FONT></DIV>
<DIV dir=3Dltr><FONT face=3DArial></FONT> </DIV>
<DIV dir=3Dltr><FONT face=3DArial>To do it right, you need to execute =
script on the
client, to determine and post the client's local time zone offset... =
much like
this:</FONT></DIV>
<DIV dir=3Dltr><FONT face=3DArial></FONT> </DIV>
<DIV dir=3Dltr><FONT face=3DArial> var dt =3D new =
Date();<BR> document.forms[0].ClientTZ.value =3D
dt.getTimezoneOffset();<BR></FONT></DIV>
<DIV dir=3Dltr><FONT face=3DArial>(Which of course assumes that an input =
called
ClientTZ has been defined in the first form object in the
document.)</FONT></DIV>
<DIV dir=3Dltr><FONT face=3DArial></FONT> </DIV>
<DIV dir=3Dltr><FONT face=3DArial>Armed with that value (which is =
expressed in
minutes of offset from UTC) you can convert between a user's local time =
and UTC,
and your code will work no matter what time zone the user happens =
to be
in... as long as the client computer's time zone is correctly set,
anyway.</FONT></DIV>
<DIV dir=3Dltr><FONT face=3DArial></FONT> </DIV>
<DIV dir=3Dltr><FONT face=3DArial></FONT> </DIV>
<DIV dir=3Dltr><FONT face=3DArial>-Mark.</FONT></DIV>
<DIV dir=3Dltr><FONT face=3DArial><FONT =
face=3DArial></FONT></FONT> </DIV>
<DIV dir=3Dltr><FONT face=3DArial><FONT =
face=3DArial></FONT></FONT> </DIV>
<DIV dir=3Dltr><BR><BR><FONT face=3DArial>>>> =
shawn [at] myemail.com<>
03/21/06 4:55 PM >>><BR></FONT></DIV>
<BLOCKQUOTE dir=3Dltr
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style=3D"FONT: 10pt Tahoma; COLOR: #000000">
<DIV>I am allowing users to save a .vcs file for an event coming from =
a
database. Everything works correctly except it is showing the =
incorrect
time. Does anyone have any clues on how to get this to show the =
time
correctly, everything else is great!</DIV>
<DIV> </DIV>
<DIV>------------------------- script begin ------------------------- =
</DIV>
<DIV>strvCalendar =3D BuildVCalendar()</DIV>
<DIV> </DIV>
<DIV>'Sends save to browser as vcs file<BR>Response.ContentType =3D
"text/x-vCalendar"<BR> Response.AddHeader "Content-Disposition",
_<BR> "filename=3DEvent" & =
".vcs;"<BR> Response.Write
strvCalendar<BR> Response.End</DIV>
<DIV> </DIV>
<DIV>Function BuildVCalendar()</DIV>
<DIV> </DIV>
<DIV> Dim dtStart, dtEnd, strSubject, strLocation, strDesc ' well =
assume
these come from a database<BR> <BR> ' -- Assuming =
Event_Begin_Date
and Event_End_Date hold<BR> ' -- Date and Time values</DIV>
<DIV> </DIV>
<DIV> dtStart =3D "20060321T233000Z"<BR> dtEnd =3D
"20060323T233000Z"<BR> ' -- <BR> strEventID =3D
"203482"<BR> strSubject =3D "Test Event"<BR> strLocation =3D =
"Columbus,
Ohio 43211"<BR> strDesc =3D "This is a test
description" <BR> <BR> BuildVCalendar =3D =
"BEGIN:VCALENDAR" &
vbCrlf &_<BR> "VERSION:1.0" & vbCrlf =
&_<BR> "BEGIN:
VEVENT" & vbCrlf &_<BR> "DTSTART:" & dtStart =
&
vbCrlf &_<BR> "DTEND:" & dtEnd & vbCrlf
&_<BR> "SUMMARY;ENCODING=3DQUOTED-PRINTABLE:" & =
strSubject &
vbCrlf &_<BR> "DESCRIPTION;ENCODING=3DQUOTED-PRINTABLE:" =
& strDesc
& vbCrlf &_<BR> "LOCATION;ENCODING=3DQUOTED-PRINTABLE:" =
&
strLocation & vbCrlf &_<BR> "UID:" & strEventID & =
dtStart
& strSubject & vbCrlf &_<BR> "PRIORITY:3" & =
vbCrlf
&_<BR> "END:VEVENT" & vbCrlf =
&_<BR> "END:VCALENDAR"
& vbCrlf</DIV>
<DIV> </DIV>
<DIV>End Function<BR>------------------------- script end
------------------------- </DIV></DIV></BLOCKQUOTE></BODY></HTML>
------=_NextPart_000_0013_01C64D02.E825E9F0--