473,386 Members | 1,790 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

How can I display web content in viewer's local time?

Suppose you have a bulletin board where of course people can post
messages and read messages composed by other people. Each message has a
time stamp on it. When someone in California comes to the site to read
a message posted by someone in New York, how do you display the time
from the timestamp in Pacific time, but when someone in New York views
the message, the time stamp is in Eastern Standard time?

When I store messages in my SQL server, I time stamp them using the
GetUTCDate() method to store the message in GMT / Universal time.

Thank you,
David

Meet people for friendship, contacts,
or romance using free instant messaging software! See a picture you
like? Click once for a private conversation with that person!
<a href="http://www.sen.us"><img
src="http://www.sen.us/mirror/SENLogo_62_31.jpg">
</a>

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 15 '05 #1
2 1779
Always storing it in UTC Time and displaying the local time in the client
app should do it. Have you tried using the DateTime.ToLocalTime() method in
your client?

--
Harshit Agarwal [MSFT]
This posting is provided "AS IS" with no warranties, and confers no rights.

"David Berman" <da**********@bose.com> wrote in message
news:ud**************@TK2MSFTNGP10.phx.gbl...
Suppose you have a bulletin board where of course people can post
messages and read messages composed by other people. Each message has a
time stamp on it. When someone in California comes to the site to read
a message posted by someone in New York, how do you display the time
from the timestamp in Pacific time, but when someone in New York views
the message, the time stamp is in Eastern Standard time?

When I store messages in my SQL server, I time stamp them using the
GetUTCDate() method to store the message in GMT / Universal time.

Thank you,
David

Meet people for friendship, contacts,
or romance using free instant messaging software! See a picture you
like? Click once for a private conversation with that person!
<a href="http://www.sen.us"><img
src="http://www.sen.us/mirror/SENLogo_62_31.jpg">
</a>

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 15 '05 #2
I'm trying to a develop web browser based application. If my server
does a database dip to get the timestamp, somehow I need to know what
the timezone is of the person viewing the web page don't I? Then I need
to figure out what the time difference is between that and UTC time, and
make date / time adjustments, but then I have to accomodate leapyears
etc. There must be an easier way.

ToLocalTime won't help because the timezone of the web server isn't
necessarily the time zone of the web site visitor.

Meet people for friendship, contacts,
or romance using free instant messaging software! See a picture you
like? Click once for a private conversation with that person!

www.SEN.us

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

33
by: selowitch | last post by:
I've been searching in vain for a way to present typographically correct fractions (not resorting to <sup> and <sub> tags) but have been frustrated by the fact that the glyphs for one-half,...
9
by: Mike | last post by:
How do I prevent SQL Server 2000 from posting successful backup completion messages to the Windows 2000 Application Event Log? I have scheduled jobs which backup my transaction logs on 50+...
9
by: bluedolphin | last post by:
Hello All: I have been brought onboard to help on a project that had some performance problems last year. I have taken some steps to address the issues in question, but a huge question mark...
11
by: Tina | last post by:
I'm in a button clicked event on mainpage.aspx. I want to display a new webpage that has just my image, which is a jpg. I want the page to be a ..jpg not an aspx so that it will be easy for the...
1
by: VP | last post by:
Could you guys please resolve this problem for me? My web form is accessing a Excel spreadsheet. I can read text info from (each cell) an excel spreadsheet. But, there's a Shape object in excel,...
29
by: Patrick | last post by:
I have the following code, which regardless which works fine and logs to the EventViewer regardless of whether <processModel/> section of machine.config is set to username="SYSTEM" or "machine" ...
7
by: TLM | last post by:
I am trying to build a web application that will contain links to files on a users local computer. I am assuming that the files will be in a known location and can display in a browser window. ...
7
by: . | last post by:
I'm having a display issue with my page, http://www.Gatorgrad.com, in IE6 and IE7b2. I know it's not the browser of choice, but I think the majority of windows users still use IE so I'd like to...
9
by: tshad | last post by:
This was posted before but the message got messed up (all NLs were stripped out for some reason). I have 2 labels that hold the name of different images on my .aspx page. <asp:Label ID="Logo"...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.