Wrox Programmer Forums
|
BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6
This is the forum to discuss the Wrox book ASP.NET 2.0 Instant Results by Imar Spaanjaars, Paul Wilton, Shawn Livermore; ISBN: 9780471749516
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 17th, 2007, 06:42 PM
Authorized User
 
Join Date: Aug 2007
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default Different time zone on my web server

I used Ajax to show up current date:
I test on local server on my computer shows up as right time zone.
but when I upload my web server, it shows 3 hrs behind.
I talked to my web server about this problem and they said, nothing they can do about to change time.
Is there any way to shows up my browser time instead of web server time?

This is my code.

label1.text=DateTime.Now.ToString


 
Old August 19th, 2007, 03:01 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Is this in any way related to the book Instant Results? If not, you're better off posting these kind of questions in a more general purpose forum here at Wrox.com.

That said, there isn't much you can do about it. DateTime.Now always returns the date at the server, not at the client, as the code runs at the server.

You could use a JavaScript date and send that to the server and work from there.

Imar


---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
 
Old August 21st, 2007, 02:45 PM
Authorized User
 
Join Date: Aug 2007
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi, again
Yes, it's releate to wrox book.
In the book, when you log in SecureDiary/DiaryMain.aspx
It shows 3 hrs different time.
I used Ajax later to time because I want to see update time to 3000
to see active time changes.
Why this time is still 3 hrs behind in client side?


Quote:
quote:Originally posted by Imar
 Hi there,

Is this in any way related to the book Instant Results? If not, you're better off posting these kind of questions in a more general purpose forum here at Wrox.com.

That said, there isn't much you can do about it. DateTime.Now always returns the date at the server, not at the client, as the code runs at the server.

You could use a JavaScript date and send that to the server and work from there.

Imar


---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
 
Old August 21st, 2007, 02:57 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Like I said, the time is *not* three hours behind. The time you see is the time from the server where your application runs....

System.DateTime.Now *always* returns the server's time.

Imar

---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004





Similar Threads
Thread Thread Starter Forum Replies Last Post
date and time in EST time zone anboss XSLT 1 May 21st, 2008 01:42 PM
time zone & day light time rajn ASP.NET 1.0 and 1.1 Professional 0 August 7th, 2007 05:02 PM
adjust zone time kherrerab BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 6 July 2nd, 2007 08:53 AM
Zone Time kherrerab BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 0 October 20th, 2006 12:30 PM
getting time zone nerssi Javascript 2 December 22nd, 2004 10:56 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.