Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / December 2007

Tip: Looking for answers? Try searching our database.

Displaying the date of the customer, in accordance with its Time zone

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Alexander Vasilevsky - 03 Dec 2007 12:02 GMT
Need to display the date of the customer, in accordance with its Time zone

http://www.alvas.net - Audio tools for C# and VB.Net developers + Christmas
gift
Duy Lam - 03 Dec 2007 13:29 GMT
> Need to display the date of the customer, in accordance with its Time zone
>
> http://www.alvas.net - Audio tools for C# and VB.Net developers + Christmas
> gift

Maybe this code helpful:

string dateString = DateTime.Now.ToString(
System.Threading.Thread.CurrentThread.CurrentUICulture.DateTimeFormat.LongDatePattern
);

Signature

Duy Lam Phuong

Alexander Vasilevsky - 03 Dec 2007 13:36 GMT
OK

http://www.alvas.net - Audio tools for C# and VB.Net developers + Christmas
gift

>> Need to display the date of the customer, in accordance with its Time
>> zone
[quoted text clipped - 7 lines]
> System.Threading.Thread.CurrentThread.CurrentUICulture.DateTimeFormat.LongDatePattern
> );
Eliyahu Goldin - 03 Dec 2007 13:54 GMT
You code runs on server. It has no knowledge about the client machine
timezone. You need to get in on client side with a javascript call

Date.getTimezoneOffset()";

the pass the value to server side in a hidden input control.

Signature

Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net

>> Need to display the date of the customer, in accordance with its Time
>> zone
[quoted text clipped - 7 lines]
> System.Threading.Thread.CurrentThread.CurrentUICulture.DateTimeFormat.LongDatePattern
> );
Mark Rae [MVP] - 03 Dec 2007 14:02 GMT
> string dateString = DateTime.Now.ToString(
> System.Threading.Thread.CurrentThread.CurrentUICulture.DateTimeFormat.LongDatePattern);

Only if the client and server happen to be in the same time zone...

Signature

Mark Rae
ASP.NET MVP
http://www.markrae.net

Duy Lam - 11 Dec 2007 16:36 GMT
>> string dateString = DateTime.Now.ToString(
>> System.Threading.Thread.CurrentThread.CurrentUICulture.DateTimeFormat.LongDatePattern);
>
> Only if the client and server happen to be in the same time zone...

If Alexander want display date in browser, it certainly should use
javascript to do.
I'm sorry because i only think this require run on one machine although
this group is aspnet :-)

Signature

Duy Lam Phuong


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.