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

  • Thread starter Thread starter Alexander Vasilevsky
  • Start date Start date
Alexander said:
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
);
 
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.

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
 
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...
 
Mark said:
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 :-)
 
Back
Top