Hi Victor, I don't think it's an unusual scenario.
I think a good approach (same as the one Outlook Web Access uses) is to
profile your users and allow them to select a Timezone that gets stored
with it.
So when they get authenticated you already know how much to add/subtract to
the UTC-converted datetime. Of course this goes along with the
recommendation of converting/storing all of your datetimes on the server in
UTC format so it's easier to so add/subtract the delta. (delta is from UTC,
which is independednt of the location of your server)
HTH,
Aldo
-- This posting is provided "AS IS" with no warranties, and confers no
rights.
--------------------
Ok, I can store the UTC per user, but, can I use the system.timezone to
correct the date/time or this object has nothing to do with ASP.Net
globalization process?
I mean, if you set the Culture or UICulture you get the ASP.Net
globalization features working, but, can I set a system.timezone parameter
for the Culture object to correct the dates?
All I don't want to do is to implement is all these calculations...
PS: I may be searching for a feature that does not exist (at least I did not
found it yet), but, since I started developing apps using .Net in version
1.0 there's a rule of thumb I always follow: "when a thing starts getting
too complicated (too much code for little tasks), study a little bit more
and you'll find a way to solve the problem using .Net itself" - I'm just not
sure if this rule applies here...
Thanks a lot,
Victor
> Hi Victor, I don't think it's an unusual scenario.
> I think a good approach (same as the one Outlook Web Access uses) is to
[quoted text clipped - 55 lines]
> | Thanks a lot,
> | Victor
Aldo Donetti [MS] - 28 Dec 2006 03:14 GMT
Hi Victor, I think you are out of luck in this case.
As you can see the BCL team has been asking for scenarios for
implementations of new methods in the TimeZone class
<http://blogs.msdn.com/bclteam/archive/2006/07/05/657242.aspx>
And they have started implementing TimeZone conversions for Orcas
<http://blogs.msdn.com/bclteam/archive/2006/10/03/System.TimeZone2-Starter-G
uide-_5B00_Kathy-Kam_5D00_.aspx>
But in your case you should not need that, because *roughly* you only need
(a) to convert .ToUniversalTime() when you store dates/times on the server
and (b) add to these dates/times the delta for each user before you display
them
A few more interesting articles
- DateTime structure + please notice the added comment and the link at the
bottom of the article
<http://msdn2.microsoft.com/en-us/library/system.datetime(VS.80).aspx>
- Webservices and Timezones
<http://blogs.msdn.com/suryaj/archive/2006/03/29/564322.aspx>
HTH
Aldo
-- This posting is provided "AS IS" with no warranties, and confers no
rights.
--------------------
| From: "Victor Reboucas" <vcreb@hotmail.com>
| References: <ua34ge4IHHA.3872@TK2MSFTNGP06.phx.gbl>
<YuN0zV9IHHA.2488@TK2MSFTNGHUB02.phx.gbl>
| Subject: Re: Changing the timezone for ASP.Net App
| Date: Thu, 21 Dec 2006 12:24:09 -0300
[quoted text clipped - 9 lines]
| Path: TK2MSFTNGHUB02.phx.gbl!TK2MSFTNGP01.phx.gbl!TK2MSFTNGP03.phx.gbl
| Xref: TK2MSFTNGHUB02.phx.gbl
microsoft.public.dotnet.internationalization:52
| X-Tomcat-NG: microsoft.public.dotnet.internationalization
|
[quoted text clipped - 77 lines]
| > | Thanks a lot,
| > | Victor