How to get the user timezone via jsTimezoneDetect and pass it to Coldfusion in onRequestStart.cfm?

220 views
Skip to first unread message

Thorsten Eilers

unread,
Aug 9, 2012, 11:50:40 AM8/9/12
to cfwh...@googlegroups.com
Good evening,
I would like to detect the user timezone via jsTimezoneDetect and pass it to Coldfusion in events/onRequestStart.cfm to a cf variable.
How do I do this? Do I need some AJAX for this?
https://bitbucket.org/pellepim/jstimezonedetect/

I am thankful for any hint/help.
Regards
Thorsten

Tom King

unread,
Aug 9, 2012, 4:17:56 PM8/9/12
to cfwh...@googlegroups.com
I fear onRequestStart will do exactly that. Trigger as the requests starts 'on the server', i.e before it even reaches the user.
Now, you *could* use JS to set a session var or something once the page has loaded...

Thorsten Eilers

unread,
Aug 10, 2012, 2:22:41 AM8/10/12
to cfwh...@googlegroups.com
The problem is I would like to show the guest users dates corresponding to their timezone.
So CF has to know the users timezone before processing the page.
What does others do in this case?
Have a welcome screen to get the timezone and have it stored as session var for following requests?
I would prefer not to have a welcome screen, and instead having the timezone data on the first request.

Andy Bellenie

unread,
Aug 10, 2012, 4:34:09 AM8/10/12
to cfwh...@googlegroups.com
I prefer to store all dates as UTC then use JS to format their display. That doesn't require storing the timezone.



--
You received this message because you are subscribed to the Google Groups "ColdFusion on Wheels" group.
To view this discussion on the web visit https://groups.google.com/d/msg/cfwheels/-/dSARYjZgQFwJ.
To post to this group, send email to cfwh...@googlegroups.com.
To unsubscribe from this group, send email to cfwheels+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/cfwheels?hl=en.

Reply all
Reply to author
Forward
0 new messages