HighDots Forums  

time zone script

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss time zone script in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
graficus
 
Posts: n/a

Default time zone script - 07-13-2003 , 05:54 PM






Does anyone have a solution to display 3 different time zones on same page,
independent of user's computer time.
(i.e. NY, LA, Chicago times - and user in Europe would still see correct
time in those cities, even tho his machine is 6 hours ahead)

Thank you.



Reply With Quote
  #2  
Old   
Dan Vendel *GOF*
 
Posts: n/a

Default Re: time zone script - 07-13-2003 , 06:22 PM






graficus wrote:

Quote:
Does anyone have a solution to display 3 different time zones on same page,
independent of user's computer time.
(i.e. NY, LA, Chicago times - and user in Europe would still see correct
time in those cities, even tho his machine is 6 hours ahead)

Thank you.



http://javascript.internet.com/clocks/world-clock.html

--
Dan Vendel - *GOF*
http://www.vendel.info
Contact me directly by clicking here:
http://contact.vendel.info
Formmail tutorial:
http://www.vendel.info/tut/formmail.html
Nested table demonstration:
http://www.vendel.info/tabletut/



Reply With Quote
  #3  
Old   
SamMan
 
Posts: n/a

Default Re: time zone script - 07-13-2003 , 06:56 PM




"Dan Vendel *GOF*" <see_my_signature_ (AT) _the_bottom_of_the_post (DOT) com> wrote in
message news:3F11DB9D.8050408 (AT) _the_bottom_of_the_post (DOT) com...
Quote:
graficus wrote:

Does anyone have a solution to display 3 different time zones on same
page,
independent of user's computer time.
(i.e. NY, LA, Chicago times - and user in Europe would still see correct
time in those cities, even tho his machine is 6 hours ahead)

Thank you.




http://javascript.internet.com/clocks/world-clock.html


Dan:
They did ask for a solution independent of the user's computer time... This
would need to be done on the server, not with JavaScript executed in the
client's browser, as does the above example.

Sam




Reply With Quote
  #4  
Old   
David R. Wheeler
 
Posts: n/a

Default Re: time zone script - 07-13-2003 , 07:44 PM



It's a bit rough but here's a ASP/VBScript solution that will do it. The downside is that the visitor will have to refresh the page to update the times. You'll need to set the offset as commented in the code for the server the page is hosted on.

<table cellpadding="5" cellspacing="0" border="1">
<caption>GMT/UTC Time Zones</caption>
<tr>
<th>GMT Offset</th>
<th>Time</th>
<th>Date</th>
</tr>
<%
For i = -12 to 12
sOffset = +5 'The time offset from GMT at the server
cTime = i + sOffset
tDiff = (DateAdd("h",cTime,Now))
Response.Write "<tr>" & vbCrLf
If i = 0 Then
Response.write "<td><b>GMT/UTC" & "</b></td>" & vbCrLf
Else
Response.write "<td>GMT " & i & "</td>" & vbCrLf
End If
Response.write "<td>" & FormatDateTime(tDiff,4) & "</td>" & vbCrLf &_
"<td>" & FormatDateTime(tDiff,1) & "</td>" & vbCrLf &_
"</tr>" &vbCrLf
Next
%>
</table>



Question... why must it be server side?

--

Dave
-----------------------------------------------------------------
If I were half as smart as people think I am...
I'd be twice as smart as I was before I forgot everything.
(Official victim of CRAFT Syndrome)
"Dan Vendel *GOF*" <see_my_signature_ (AT) _the_bottom_of_the_post (DOT) com> wrote

Quote:
graficus wrote:

Does anyone have a solution to display 3 different time zones on same page,
independent of user's computer time.
(i.e. NY, LA, Chicago times - and user in Europe would still see correct
time in those cities, even tho his machine is 6 hours ahead)

Thank you.




http://javascript.internet.com/clocks/world-clock.html

--
Dan Vendel - *GOF*
http://www.vendel.info
Contact me directly by clicking here:
http://contact.vendel.info
Formmail tutorial:
http://www.vendel.info/tut/formmail.html
Nested table demonstration:
http://www.vendel.info/tabletut/


Reply With Quote
  #5  
Old   
Murray *TMM*
 
Posts: n/a

Default Re: time zone script - 07-14-2003 , 08:31 AM



Here's one I use -

<h1>Look at your watch</h1>

8)

--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver MX
(If you *MUST* email me, don't LAUGH when you do so!)
==================
news://forums.macromedia.com/macromedia.dreamweaver - THE BEST WAY TO GET
ANSWERS
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.DreamweaverFAQ.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================


"David R. Wheeler" <dont-want (AT) no (DOT) spam> wrote

It's a bit rough but here's a ASP/VBScript solution that will do it. The
downside is that the visitor will have to refresh the page to update the
times. You'll need to set the offset as commented in the code for the server
the page is hosted on.

<table cellpadding="5" cellspacing="0" border="1">
<caption>GMT/UTC Time Zones</caption>
<tr>
<th>GMT Offset</th>
<th>Time</th>
<th>Date</th>
</tr>
<%
For i = -12 to 12
sOffset = +5 'The time offset from GMT at the server
cTime = i + sOffset
tDiff = (DateAdd("h",cTime,Now))
Response.Write "<tr>" & vbCrLf
If i = 0 Then
Response.write "<td><b>GMT/UTC" & "</b></td>" & vbCrLf
Else
Response.write "<td>GMT " & i & "</td>" & vbCrLf
End If
Response.write "<td>" & FormatDateTime(tDiff,4) & "</td>" & vbCrLf &_
"<td>" & FormatDateTime(tDiff,1) & "</td>" & vbCrLf &_
"</tr>" &vbCrLf
Next
%>
</table>



Question... why must it be server side?

--

Dave
-----------------------------------------------------------------
If I were half as smart as people think I am...
I'd be twice as smart as I was before I forgot everything.
(Official victim of CRAFT Syndrome)
"Dan Vendel *GOF*" <see_my_signature_ (AT) _the_bottom_of_the_post (DOT) com> wrote in
message news:3F11DB9D.8050408 (AT) _the_bottom_of_the_post (DOT) com...
Quote:
graficus wrote:

Does anyone have a solution to display 3 different time zones on same
page,
independent of user's computer time.
(i.e. NY, LA, Chicago times - and user in Europe would still see correct
time in those cities, even tho his machine is 6 hours ahead)

Thank you.




http://javascript.internet.com/clocks/world-clock.html

--
Dan Vendel - *GOF*
http://www.vendel.info
Contact me directly by clicking here:
http://contact.vendel.info
Formmail tutorial:
http://www.vendel.info/tut/formmail.html
Nested table demonstration:
http://www.vendel.info/tabletut/




Reply With Quote
  #6  
Old   
David R. Wheeler
 
Posts: n/a

Default Re: time zone script - 07-14-2003 , 08:32 AM





--

Dave
-----------------------------------------------------------------
If I were half as smart as people think I am...
I'd be twice as smart as I was before I forgot everything.
(Official victim of CRAFT Syndrome)

=======================



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.