Time incorrect when running this script (exporting .vcs file)

Time incorrect when running this script (exporting .vcs file)

am 21.03.2006 22:55:11 von Shawn Ferguson

--____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 -------------------------=20
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
=20
' -- Assuming Event_Begin_Date and Event_End_Date hold
' -- Date and Time values

dtStart =3D "20060321T233000Z"
dtEnd =3D "20060323T233000Z"
' --=20
strEventID =3D "203482"
strSubject =3D "Test Event"
strLocation =3D "Columbus, Ohio 43211"
strDesc =3D "This is a test description"=20
=20
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


>


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 "20060323T2330=
00Z"
 ' --
 strEventID =3D "203482"
 strSubject =
=3D "Test Event"
 strLocation =3D "Columbus, Ohio 43211"
 s=
trDesc =3D "This is a test description" 
 
 BuildVCale=
ndar =3D "BEGIN:VCALENDAR" & vbCrlf &_
 "VERSION:1.0" =
& vbCrlf &_
 "BEGIN: VEVENT" & vbCrlf &_
 "=
DTSTART:" & dtStart  & vbCrlf &_
 "DTEND:" & =
dtEnd  & vbCrlf &_
 "SUMMARY;ENCODING=3DQUOTED-PRINTAB=
LE:" & strSubject & vbCrlf &_
 "DESCRIPTION;ENCODING=3D=
QUOTED-PRINTABLE:" & strDesc & vbCrlf &_
 "LOCATION;ENC=
ODING=3DQUOTED-PRINTABLE:" & strLocation & vbCrlf &_
 "=
UID:" & strEventID & dtStart & strSubject & vbCrlf =
&_
 "PRIORITY:3" & vbCrlf &_
 "END:VEVENT" =
& vbCrlf &_
 "END:VCALENDAR" & vbCrlf

 

End Function
------------------------- script  end =
-------------------------


--____LCRUJIMHIPVJXLFNRMNM____--

--____KXJCTNHTBQGOSBEWUGCS____--

Re: Time incorrect when running this script (exporting .vcs file)

am 21.03.2006 23:00:51 von Shawn Ferguson

--____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? =20

>>> shawn@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 -------------------------=20
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
=20
' -- Assuming Event_Begin_Date and Event_End_Date hold
' -- Date and Time values

dtStart =3D "20060321T233000Z"
dtEnd =3D "20060323T233000Z"
' --=20
strEventID =3D "203482"
strSubject =3D "Test Event"
strLocation =3D "Columbus, Ohio 43211"
strDesc =3D "This is a test description"=20
=20
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


>

The time shows up =
as 6:30 pm opposed 11:30 pm?  Any clues? 

>>> =
shawn@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 "20060323T2330=
00Z"
 ' --
 strEventID =3D "203482"
 strSubject =
=3D "Test Event"
 strLocation =3D "Columbus, Ohio 43211"
 s=
trDesc =3D "This is a test description" 
 
 BuildVCale=
ndar =3D "BEGIN:VCALENDAR" & vbCrlf &_
 "VERSION:1.0" =
& vbCrlf &_
 "BEGIN: VEVENT" & vbCrlf &_
 "=
DTSTART:" & dtStart  & vbCrlf &_
 "DTEND:" & =
dtEnd  & vbCrlf &_
 "SUMMARY;ENCODING=3DQUOTED-PRINTAB=
LE:" & strSubject & vbCrlf &_
 "DESCRIPTION;ENCODING=3D=
QUOTED-PRINTABLE:" & strDesc & vbCrlf &_
 "LOCATION;ENC=
ODING=3DQUOTED-PRINTABLE:" & strLocation & vbCrlf &_
 "=
UID:" & strEventID & dtStart & strSubject & vbCrlf =
&_
 "PRIORITY:3" & vbCrlf &_
 "END:VEVENT" =
& vbCrlf &_
 "END:VCALENDAR" & vbCrlf

 

End Function
------------------------- script  end =
-------------------------


--____OZLUNHAUXNMZMULGPSDC____--

--____IPYWWLUUARCUWLVQEVMO____--

Re: Time incorrect when running this script (exporting .vcs file)

am 22.03.2006 01:17:10 von mmcginty

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@myemail.com" wrote in message =
news:%23LIlsLTTGHA.1688@TK2MSFTNGP11.phx.gbl...
The time shows up as 6:30 pm opposed 11:30 pm? Any clues? =20
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@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 -------------------------=20
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
=20
' -- Assuming Event_Begin_Date and Event_End_Date hold
' -- Date and Time values

dtStart =3D "20060321T233000Z"
dtEnd =3D "20060323T233000Z"
' --=20
strEventID =3D "203482"
strSubject =3D "Test Event"
strLocation =3D "Columbus, Ohio 43211"
strDesc =3D "This is a test description"=20
=20
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



charset=3Diso-8859-1">



bgColor=3D#ffffff>

 

style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
"" =
< href=3D"mailto:SFergus2@cscc.edu">SFergus2@cscc.edu> wrote in =
message =
href=3D"news:%23LIlsLTTGHA.1688@TK2MSFTNGP11.phx.gbl">news:% 23LIlsLTTGHA.=
1688@TK2MSFTNGP11.phx.gbl...

The time shows up as 6:30 pm opposed 11:30 pm?  Any =
clues? =20

Surely it's a time zone =
issue.  You're=20
where, in Ohio?  Would your time zone happen to be UTC -5:00?  =
Check=20
the spec for .vcs, wouldn't be much of a surprise if it requires you to =
convert=20
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=20
client, to determine and post the client's local time zone offset... =
much like=20
this:

 

    var dt =3D new =

Date();
    document.forms[0].ClientTZ.value =
dt.getTimezoneOffset();

(Which of course assumes that an input =
called=20
ClientTZ has been defined in the first form object in the=20
document.)

 

Armed with that value (which is =
expressed in=20
minutes of offset from UTC) you can convert between a user's local time =
and UTC,=20
and your code will work no matter what time zone the user happens =
to be=20
in... as long as the client computer's time zone is correctly set,=20
anyway.

 

 

-Mark.

face=3DArial> 

face=3DArial> 



>>> =
shawn@myemail.com<>=20
03/21/06 4:55 PM >>>

style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">

I am allowing users to save a .vcs file for an event coming from =
a=20
database.  Everything works correctly except it is showing the =
incorrect=20
time.  Does anyone have any clues on how to get this to show the =
time=20
correctly, everything else is great!

 

------------------------- script begin ------------------------- =

strvCalendar =3D BuildVCalendar()

 

'Sends save to browser as vcs file
Response.ContentType =
"text/x-vCalendar"
 Response.AddHeader "Content-Disposition",=20
_
  "filename=3DEvent" & =
".vcs;"
 Response.Write=20
strvCalendar
 Response.End

 

Function BuildVCalendar()

 

 Dim dtStart, dtEnd, strSubject, strLocation, strDesc ' well =
assume=20
these come from a database
 
 ' -- Assuming =
Event_Begin_Date=20
and Event_End_Date hold
 ' -- Date and Time values

 

 dtStart =3D "20060321T233000Z"
 dtEnd =
"20060323T233000Z"
 ' --
 strEventID =
"203482"
 strSubject =3D "Test Event"
 strLocation =3D =
"Columbus,=20
Ohio 43211"
 strDesc =3D "This is a test=20
description" 
 
 BuildVCalendar =3D =
"BEGIN:VCALENDAR" &=20
vbCrlf &_
 "VERSION:1.0" & vbCrlf =
&_
 "BEGIN:=20
VEVENT" & vbCrlf &_
 "DTSTART:" & dtStart  =
&=20
vbCrlf &_
 "DTEND:" & dtEnd  & vbCrlf=20
&_
 "SUMMARY;ENCODING=3DQUOTED-PRINTABLE:" & =
strSubject &=20
vbCrlf &_
 "DESCRIPTION;ENCODING=3DQUOTED-PRINTABLE:" =
& strDesc=20
& vbCrlf &_
 "LOCATION;ENCODING=3DQUOTED-PRINTABLE:" =
&=20
strLocation & vbCrlf &_
 "UID:" & strEventID & =
dtStart=20
& strSubject & vbCrlf &_
 "PRIORITY:3" & =
vbCrlf=20
&_
 "END:VEVENT" & vbCrlf =
&_
 "END:VCALENDAR"=20
& vbCrlf

 

End Function
------------------------- script  end=20
-------------------------


------=_NextPart_000_0013_01C64D02.E825E9F0--