Web Design and Development Forums

ASP Capturing User Time Zone

This is a discussion on "ASP Capturing User Time Zone" within the ASP Forum section. This forum, and the thread "ASP Capturing User Time Zone are both part of the Program Your Website category.


Go Back   Webforumz.com > Program Your Website > ASP Forum

Welcome to Webforumz.com.
Register Now Register now!

Reply
 
LinkBack Thread Tools Rate Thread
Old Dec 21st, 2007, 08:36   #1 (permalink)
Most Reputable Member
 
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,567
Blog Entries: 2
Send a message via Yahoo to Monie
ASP Capturing User Time Zone

Does anyone know how to do this the ASP way?

What I want to do in my site is to display each registered user their own time zone. Say, my place now would be Friday 17:30, and swagner would be Thursday 04:30.
During the registration process, I have allow the user to select their own time zone and later saved it into the database.
I will have a member list page to display all this registered user in a list format. At the end of each field, I will display this information so that I know what is the real time for each of my member list

Any guide
Cheers and merry Christmas.
__________________

Monie is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Dec 21st, 2007, 12:15   #2 (permalink)
Up'n'Coming Member
 
Join Date: Sep 2007
Location: Wales, UK
Age: 35
Posts: 75
Send a message via MSN to robbied72 Send a message via Skype™ to robbied72
Re: ASP Capturing User Time Zone

When they are registering you could use a drop down list like this - http://www.csgnetwork.com/timezonedropdown.html - Set the values on the drop down to the corespondin - & + hours and write it away to your database, then you can use the DateDiff function to display the correct time for the user when they login.
__________________
Languages: ASP, RUBY(a little), XML, XHTML, CSS, JavaScript, JQuery - www.bizmo.co.uk
robbied72 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Dec 22nd, 2007, 02:05   #3 (permalink)
Most Reputable Member
 
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,567
Blog Entries: 2
Send a message via Yahoo to Monie
Re: ASP Capturing User Time Zone

I am using something similar like this drop down menu (from webforumz):

HTML: Select all
<select name="timezoneoffset" id="sel_timezoneoffset">
<option value="-12" class="fjdpth0" >(GMT -12:00) Eniwetok, Kwajalein</option>
<option value="-11" class="fjdpth0" >(GMT -11:00) Midway Island, Samoa</option>
<option value="-10" class="fjdpth0" >(GMT -10:00) Hawaii</option>
<option value="-9" class="fjdpth0" >(GMT -9:00) Alaska</option>
<option value="-8" class="fjdpth0" >(GMT -8:00) Pacific Time (US &amp; Canada)</option>
<option value="-7" class="fjdpth0" >(GMT -7:00) Mountain Time (US &amp; Canada)</option>
<option value="-6" class="fjdpth0" >(GMT -6:00) Central Time (US &amp; Canada), Mexico City</option>
<option value="-5" class="fjdpth0" >(GMT -5:00) Eastern Time (US &amp; Canada), Bogota, Lima</option>
<option value="-4" class="fjdpth0" >(GMT -4:00) Atlantic Time (Canada), Caracas, La Paz</option>
<option value="-3.5" class="fjdpth0" >(GMT -3:30) Newfoundland</option>
<option value="-3" class="fjdpth0" >(GMT -3:00) Brazil, Buenos Aires, Georgetown</option>
<option value="-2" class="fjdpth0" >(GMT -2:00) Mid-Atlantic</option>
<option value="-1" class="fjdpth0" >(GMT -1:00 hour) Azores, Cape Verde Islands</option>
<option value="0" class="fjdpth0" >(GMT) Western Europe Time, London, Lisbon, Casablanca</option>
<option value="1" class="fjdpth0" >(GMT +1:00 hour) Brussels, Copenhagen, Madrid, Paris</option>
<option value="2" class="fjdpth0" >(GMT +2:00) Kaliningrad, South Africa</option>
<option value="3" class="fjdpth0" >(GMT +3:00) Baghdad, Riyadh, Moscow, St. Petersburg</option>
<option value="3.5" class="fjdpth0" >(GMT +3:30) Tehran</option>
<option value="4" class="fjdpth0" >(GMT +4:00) Abu Dhabi, Muscat, Baku, Tbilisi</option>
<option value="4.5" class="fjdpth0" >(GMT +4:30) Kabul</option>
<option value="5" class="fjdpth0" >(GMT +5:00) Ekaterinburg, Islamabad, Karachi, Tashkent</option>
<option value="5.5" class="fjdpth0" >(GMT +5:30) Bombay, Calcutta, Madras, New Delhi</option>
<option value="6" class="fjdpth0" >(GMT +6:00) Almaty, Dhaka, Colombo</option>
<option value="7" class="fjdpth0" >(GMT +7:00) Bangkok, Hanoi, Jakarta</option>
<option value="8" class="fjdpth0" selected="selected">(GMT +8:00) Beijing, Perth, Singapore, Hong Kong</option>
<option value="9" class="fjdpth0" >(GMT +9:00) Tokyo, Seoul, Osaka, Sapporo, Yakutsk</option>
<option value="9.5" class="fjdpth0" >(GMT +9:30) Adelaide, Darwin</option>
<option value="10" class="fjdpth0" >(GMT +10:00) Eastern Australia, Guam, Vladivostok</option>
<option value="11" class="fjdpth0" >(GMT +11:00) Magadan, Solomon Islands, New Caledonia</option>
<option value="12" class="fjdpth0" >(GMT +12:00) Auckland, Wellington, Fiji, Kamchatka</option>
</select>
But what I do not understand is the DateDiff function!
I know that it is used for differentiating two date and get the different between them.

How do I apply this function?
__________________


Last edited by Monie; Dec 22nd, 2007 at 02:15.
Monie is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Dec 28th, 2007, 02:56   #4 (permalink)
Most Reputable Member
 
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,567
Blog Entries: 2
Send a message via Yahoo to Monie
Everyone is on CHRISTMAS VACATION huh?

Perhaps MIXING JavaScript with ASP? Let me try my luck..
__________________


Last edited by Monie; Dec 28th, 2007 at 07:27. Reason: make thread looks neat..
Monie is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Dec 29th, 2007, 19:53   #5 (permalink)
Junior Member
 
Join Date: Oct 2007
Location: Israel
Age: 20
Posts: 31
Re: ASP Capturing User Time Zone

do it on javascript.
make countries array (country, value, GMT) and loop it to a select box.
then make the "if" term

PHP: Select all

if (countries_arr("GMT") = user_GMT)
  
document.write "selected='selected'"
i think i got errors on that code O_o
simple thought :}


now, how do we get the user GMT?
PHP: Select all

var = new Date()
var 
gmtHours d.getTimezoneOffset()/60;
document.write("The local time zone is: GMT " gmtHours); 
learn js :P

____________
look on the samples here - DateDiff
Eran is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Dec 31st, 2007, 02:03   #6 (permalink)
Most Reputable Member
 
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,567
Blog Entries: 2
Send a message via Yahoo to Monie
Re: ASP Capturing User Time Zone

I did not have any problem displaying the user time!
My problem is, in my page, I have a special page that will display all the user (that was currently online) in a list form.. and I wanted to display THEIR real-time clock!

Something like this:

+--------+----------------------+
| User 1 | 10:30am Sunday |
+--------+----------------------+
| User 2 | 23:30pm Saturday |
+--------+----------------------+
| User 3 | 05:30am Sunday |
+--------+----------------------+
__________________


Last edited by Monie; Dec 31st, 2007 at 02:06.
Monie is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Dec 31st, 2007, 06:55   #7 (permalink)
Most Reputable Member
 
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,567
Blog Entries: 2
Send a message via Yahoo to Monie
Re: ASP Capturing User Time Zone

I found a way in ASP but couldn't seems to fulfill my requirement

HTML: Select all
Borneo<%=TimeZone(0,0,0)%>
New York Time<%=TimeZone(0,13,0)%> 'minus 13 hours from local time
will print:

My Time: 11:00 AM
New York Time: 10:00 PM

without the DAY..
I need to print the day as well. It suppose to be like this:

My Time: 11:00 AM Monday
New York Time: 10:00 PM Sunday
__________________


Last edited by Monie; Jan 2nd, 2008 at 01:37. Reason: bump thread!
Monie is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Jan 11th, 2008, 12:19   #8 (permalink)
Junior Member
 
Join Date: Oct 2007
Location: Israel
Age: 20
Posts: 31
Re: ASP Capturing User Time Zone

okay then
i think the best way to do that is to retrieve from the user his GMT (btw, you can do it from the ip.. search for ip to country script or something like it). the user will fill his GMT to your db and you will calculate the time and zone :}
i think that date difference can do that but i'm not sure. anyway this isn't that hard script and with a little effort you can do this by your own. good luck!
tell us what you thought of.. or if you need any help.
Eran is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Jan 12th, 2008, 10:01   #9 (permalink)
Administrator
 
alexgeek's Avatar
 
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 4,102
Blog Entries: 9
Send a message via MSN to alexgeek
Re: ASP Capturing User Time Zone

Why not:
Code: Select all
Response.Write(TimeZone(0,13,0) & FormatDateTime(Date, 1))
That would work wouldn't it?
__________________
Languages: PHP, mySQL (queries), C#, (X)html, CSS, JS.


alexgeek is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Jan 13th, 2008, 23:43   #10 (permalink)
Most Reputable Member
 
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,567
Blog Entries: 2
Send a message via Yahoo to Monie
Re: ASP Capturing User Time Zone

I didn't have enough time to solve this problem, being a bit busy lately..
I'll look at it ASAP, Thanks for all the suggestion.

Let me have a look at your idea Eran, thanks.
__________________

Monie is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
capturing images QuikFrozen JavaScript Forum 1 Aug 28th, 2007 15:28
client-zone.co.uk cullinanweb Free Web Site Critique 2 Jan 30th, 2007 11:15
Fun Zone World - Online Gaming Center brians Free Web Site Critique 9 Dec 23rd, 2006 12:04
Adjusting time from server time to local time Tim356 ASP Forum 10 Jun 21st, 2004 14:57
New user of SQL*Plus....Can anyone help Reeno File Based Storage and Others 9 Apr 27th, 2004 20:50



Latest Updates

All Points SEO Security Advisory - CHECK YOUR SITE NOW!

Creative Coding :: February 2008

Webforumz is sponsored by: WESH UK Web Hosting
All times are GMT. The time now is 20:11.

Sleep Study Scoring :: Free Bet :: Website Templates :: Online Betting :: Bookmakers :: Funny Quotes :: Internet Recruitment Software :: Microsoft CRM Experts :: Online Casino :: Decorated Christmas Trees :: Midwife Forums :: Football Betting :: Ecommerce Software :: Web Hosting :: Football Stats :: Dry Cleaning Collection :: xtreme wales - extreme clothing :: Apuestas :: Sharepoint Consultants :: Website Optimisation :: Office Clearance London :: Sharepoint Experts :: Sports Betting :: Casino :: Website Templates :: Web Design Development India :: Online Gambling

Powered by: vBulletin Version 3.7, Copyright ©2000 - 2008, Jelsoft Enterprises Limited.
© 2003-2008 Webforumz.com : All Rights Reserved
Search Engine Friendly URLs by vBSEO 3.2.0 RC6


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59