time zone in wep application.

G

Guest

What is the best way to deal time zone difference in Wep application.

Is there a best pattern and practice for this?
 
J

Joey

I have had good success in using UTC (Universal Timing
Convention/"Zulu"/Greenwich/etc) dates/times. It is even easier (for
you) if you just post them that way on your site... As far as asp.net
goes, the DateTime functions already have UTC built
in...(DateTime.UtcNow instead of DateTime.Now, etc...). Also, in the
case of MS SQL 2005 (and maybe MS SQL 2000?), there are built in
functions also...GETUTCDATE() instead of GETDATE()...etc. This is just
an idea...
 
M

Marlon R

Thanks Joey,
I am aware of these options.
Are there any built-in communications between browser and server that would
indicate the current time zone for the client computer .

I know that the getTimeZoneOffset method can be used to determine the
difference local time and GMT.
I was just hope that a method was already implemented or a best pratice.

thanks again
 
S

Steven Cheng[MSFT]

Thanks for Joey's suggestion.

Hi Marlon,

For ASP.NET application it running on the serverside so it has limited
access to most of the clientside info. And so far for getting clientside
timezone info, you can consider Joey's suggest that use javascript to get
the TimezoneOffset .... e.g:

<script language="javascript">
function Disp_TZ()
{
var dt = new Date();

var offsetMin =dt.getTimezoneOffset()/60;

alert("Your local timezone offset: " + offsetMin + " ");
}
</script>

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)




--------------------
| From: "Joey" <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| Subject: Re: time zone in wep application.
| Date: 12 Jan 2006 08:20:41 -0800
| Organization: http://groups.google.com
| Lines: 3
| Message-ID: <[email protected]>
| References: <[email protected]>
| <[email protected]>
| <#[email protected]>
| NNTP-Posting-Host: 155.147.14.9
| Mime-Version: 1.0
| Content-Type: text/plain; charset="iso-8859-1"
| X-Trace: posting.google.com 1137082845 22686 127.0.0.1 (12 Jan 2006
16:20:45 GMT)
| X-Complaints-To: (e-mail address removed)
| NNTP-Posting-Date: Thu, 12 Jan 2006 16:20:45 +0000 (UTC)
| In-Reply-To: <#[email protected]>
| User-Agent: G2/0.2
| X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1;
..NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.1; .NET CLR
1.0.3705),gzip(gfe),gzip(gfe)
| Complaints-To: (e-mail address removed)
| Injection-Info: g47g2000cwa.googlegroups.com; posting-host=155.147.14.9;
| posting-account=quLkng0AAADPxeWcCK254A0yusgzOfm6
| Path:
TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-onli
ne.de!border2.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.gigan
ews.com!postnews.google.com!g47g2000cwa.googlegroups.com!not-for-mail
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:370367
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Couldn't you use getTimeZoneOffset to apply to UTC and get their local
| times?
|
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top