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

  • Thread starter Thread starter David Berman
  • Start date Start date
D

David Berman

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>
 
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?
 
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
 
Back
Top