A different zone?

openmind's picture

He has: 945 posts

Joined: Aug 2001

Is there any way to detect a users timezone when they arrive at a site and then site a variable that will accordingly adjust the time displayed to them?

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

Use javascript - it reads the time off their computer, not the server.

openmind's picture

He has: 945 posts

Joined: Aug 2001

K,

I'm a ColdFsuion Junkie! I can set a ColdFusion variable to my hearts content but when it comes to JavaScript, my brain and head part company.

How do I set the users time on their PC to a variable that ColdFusion can understand?

This thread seems to be bordering on Server side scripting so feel free to move it if necessary!

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

Is it for display or do you need to use that time? Because if it's just for display, you can use the Date() constructor in JavaScript.

This is a problem between server side and client side scripting. If it's really important that the user have a certain timezone, it would be better to get them to tell you what it is and set a cookie.

detox's picture

They have: 571 posts

Joined: Feb 2001

have to agree with suzanne here. I have had experience with integrating Javascript variables into VB script ASP, but I stay away from CF. How much support of session variables does CF have when it comes to date/time? I know in ASP I simply set the LCID (Locale Identifiers ) to Australian time. Is the same functionality present in CF?

openmind's picture

He has: 945 posts

Joined: Aug 2001

I've done a good search on Marcromedia's knowledge base for the LCID session variable and the like but not really come up with anything.

I think what I'll do is build it into the registration form to set the offset from the server time to wherever the user is. The cookie will bring back their member ID when they return and adjust the time...

Guess I was just looking for the clever approach....

Note to self: Stop living the MICSA approach......

Make It Complicated Smartarse!! Smiling

Thnx for the help though!

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.