HighDots Forums  

<%=Time()%> Eastern Time?

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss <%=Time()%> Eastern Time? in the Macromedia Dreamweaver forum.



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

Default <%=Time()%> Eastern Time? - 08-02-2004 , 06:29 PM






This command seem to insert Easetern time and I am on the West Coast. What do I need to do to compensate for the 3 hours?


Thank you

Reply With Quote
  #2  
Old   
danilocelic
 
Posts: n/a

Default Re: <%=Time()%> Eastern Time? - 08-02-2004 , 06:58 PM






dprulhiere wrote:

Quote:
This command seem to insert Easetern time and I am on the West Coast. What do I need to do to compensate for the 3 hours?
That code doesn't give you the time on your machine, it gives you the time on the web server.

Do you need to display western time all the time, or do you need display the current time no matter what the visitor's location?





--
Enjoy,
Danilo Celic
Quote:
Extending Knowledge Daily
http://www.CommunityMX.com/

Reply With Quote
  #3  
Old   
Paul Whitham TMM
 
Posts: n/a

Default Re: <%=Time()%> Eastern Time? - 08-02-2004 , 07:00 PM



Your server must be on the East Coast. To get your time you need to do
something like like

<%
ServTime = Time()
WCTime = dateAdd("h",3,ServTime)
%>

<%=WCTime%>

--
Regards

Paul Whitham
Macromedia Certified Professional for Dreamweaver MX2004
Valleybiz Internet Design
www.valleybiz.net

Team Macromedia Volunteer for Ultradev/Dreamweaver MX
www.macromedia.com/support/forums/team_macromedia

"dprulhiere" <webforumsuser (AT) macromedia (DOT) com> wrote

Quote:
This command seem to insert Easetern time and I am on the West Coast.
What do I need to do to compensate for the 3 hours?


Thank you



Reply With Quote
  #4  
Old   
danilocelic
 
Posts: n/a

Default Re: <%=Time()%> Eastern Time? - 08-02-2004 , 07:18 PM



Paul Whitham TMM wrote:

Quote:
Your server must be on the East Coast. To get your time you need to do
something like like

%
ServTime = Time()
WCTime = dateAdd("h",3,ServTime)
%

%=WCTime%
Paul,

Wouldn't that place the time 3 hours ahead of what it is already, rather than 3 hours behind?


--
Enjoy,
Danilo Celic
Quote:
Extending Knowledge Daily
http://www.CommunityMX.com/

Reply With Quote
  #5  
Old   
Kindler Chase
 
Posts: n/a

Default Re: <%=Time()%> Eastern Time? - 08-02-2004 , 07:24 PM



danilocelic wrote:
Quote:
Paul Whitham TMM wrote:

Your server must be on the East Coast. To get your time you need to
do something like like

%
ServTime = Time()
WCTime = dateAdd("h",3,ServTime)
%

%=WCTime%

Paul,

Wouldn't that place the time 3 hours ahead of what it is already,
rather than 3 hours behind?
Yes.

Should also Dim the variables

<%
Dim ServTime, WCTime
ServTime = Time()
WCTime = dateAdd("h",-3,ServTime)
%>

<%=WCTime%>

--
kindler chase
http://www.ncubed.com
Home of SuperInvoice: The Online Invoicing Application.
Organize your billing process and impress your clients.

news://news.ncubed.com/support
n3 Support Group




Reply With Quote
  #6  
Old   
danilocelic
 
Posts: n/a

Default Re: <%=Time()%> Eastern Time? - 08-02-2004 , 07:26 PM



Kindler Chase wrote:

Quote:
%
Dim ServTime, WCTime
ServTime = Time()
WCTime = dateAdd("h",-3,ServTime)
%

%=WCTime%
Kindler,

How would one go about getting the client's time from wthin ASP?

I was going to suggest a client side javaScript.


--
Enjoy,
Danilo Celic
Quote:
Extending Knowledge Daily
http://www.CommunityMX.com/

Reply With Quote
  #7  
Old   
Kindler Chase
 
Posts: n/a

Default Re: <%=Time()%> Eastern Time? - 08-02-2004 , 07:31 PM



danilocelic wrote:
Quote:
Kindler Chase wrote:

%
Dim ServTime, WCTime
ServTime = Time()
WCTime = dateAdd("h",-3,ServTime)
%

%=WCTime%

Kindler,

How would one go about getting the client's time from wthin ASP?

I was going to suggest a client side javaScript.

You'd have to:
1. get the time on the client side w/ JavaScript.
2. send that time back to the server (could use a URL param or similar)
3. convert as needed on the server.
4. send back to the client side.

I'm sure other folks will have much more clever methods as well

--
kindler chase
http://www.ncubed.com
Home of SuperInvoice: The Online Invoicing Application.
Organize your billing process and impress your clients.

news://news.ncubed.com/support
n3 Support Group




Reply With Quote
  #8  
Old   
John Gaver
 
Posts: n/a

Default Re: <%=Time()%> Eastern Time? - 08-02-2004 , 07:42 PM



On 8/2/04 6:26 PM, in article cemiim$h57$1 (AT) forums (DOT) macromedia.com,
"danilocelic" <danilo (AT) shimmerphase (DOT) com> wrote:

Quote:
I was going to suggest a client side javaScript.
I think that this would work. It would give the long date. You could tailor
it down to the format that you want.

var today = new Date();
dayStr = today.toLocaleString();
document.write(dayStr);

But, this returns the time that the visitor actually "opens" the page, using
the visitor's time zone, not the time that the page was "modified". However,
it could be placed in a larger JS that uses this piece to determine the time
of modification, in the visitor's TZ.

John Gaver
Action America
(forget everything to contact me direct)

Microsoft: (n) Job security for IT consultants.



Reply With Quote
  #9  
Old   
Les Matthews
 
Posts: n/a

Default Re: <%=Time()%> Eastern Time? - 08-02-2004 , 07:47 PM



How about this JavaScript/ASP solution?
http://www.devx.com/tips/Tip/13594

"danilocelic" <danilo (AT) shimmerphase (DOT) com> wrote

Quote:
Kindler Chase wrote:

%
Dim ServTime, WCTime
ServTime = Time()
WCTime = dateAdd("h",-3,ServTime)
%

%=WCTime%

Kindler,

How would one go about getting the client's time from wthin ASP?

I was going to suggest a client side javaScript.


--
Enjoy,
Danilo Celic
| Extending Knowledge Daily
| http://www.CommunityMX.com/



Reply With Quote
  #10  
Old   
Paul Whitham TMM
 
Posts: n/a

Default Re: <%=Time()%> Eastern Time? - 08-02-2004 , 08:57 PM



Oops, are are so right. Never had to do a backwards conversion as any server
in world outside of New Zealand always has a time less than us. Where most
of my sites are located I have to add 17 hours.

--
Regards

Paul Whitham
Macromedia Certified Professional for Dreamweaver MX2004
Valleybiz Internet Design
www.valleybiz.net

Team Macromedia Volunteer for Ultradev/Dreamweaver MX
www.macromedia.com/support/forums/team_macromedia

"danilocelic" <danilo (AT) shimmerphase (DOT) com> wrote

Quote:
Paul Whitham TMM wrote:

Your server must be on the East Coast. To get your time you need to do
something like like

%
ServTime = Time()
WCTime = dateAdd("h",3,ServTime)
%

%=WCTime%

Paul,

Wouldn't that place the time 3 hours ahead of what it is already, rather
than 3 hours behind?


--
Enjoy,
Danilo Celic
| Extending Knowledge Daily
| http://www.CommunityMX.com/



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.