473,320 Members | 1,991 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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

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
Dec 3 '07 #1
5 1318
Alexander Vasilevsky wrote:
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.CurrentUICul ture.DateTimeFormat.LongDatePattern
);

--
Duy Lam Phuong
Dec 3 '07 #2
OK

http://www.alvas.net - Audio tools for C# and VB.Net developers + Christmas
gift
"Duy Lam" <du**********@gmail.comwrote in message
news:OS**************@TK2MSFTNGP06.phx.gbl...
Alexander Vasilevsky wrote:
>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.CurrentUICul ture.DateTimeFormat.LongDatePattern
);

--
Duy Lam Phuong

Dec 3 '07 #3
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
"Duy Lam" <du**********@gmail.comwrote in message
news:OS**************@TK2MSFTNGP06.phx.gbl...
Alexander Vasilevsky wrote:
>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.CurrentUICul ture.DateTimeFormat.LongDatePattern
);

--
Duy Lam Phuong

Dec 3 '07 #4
"Duy Lam" <du**********@gmail.comwrote in message
news:OS**************@TK2MSFTNGP06.phx.gbl...
string dateString = DateTime.Now.ToString(
System.Threading.Thread.CurrentThread.CurrentUICul ture.DateTimeFormat.LongDatePattern);
Only if the client and server happen to be in the same time zone...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Dec 3 '07 #5
Mark Rae [MVP] wrote:
"Duy Lam" <du**********@gmail.comwrote in message
news:OS**************@TK2MSFTNGP06.phx.gbl...
>string dateString = DateTime.Now.ToString(
System.Threading.Thread.CurrentThread.CurrentUICu lture.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 :-)

--
Duy Lam Phuong
Dec 11 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Simon Brooke | last post by:
I'm investigating a bug a customer has reported in our database abstraction layer, and it's making me very unhappy. Brief summary: I have a database abstraction layer which is intended to...
2
by: lou | last post by:
When sending a date value to a web service, does .NET know what time zone that date is sent from? The reason I ask is because I have client software that sends data to our web service and when a...
4
by: Robert Scarborough | last post by:
I have a Table in a Typed Dataset which contains a Date field called EventDate. I've ensured that the field is defined as Date as opposed to DateTime in the Typed Dataset. When I generate an...
11
by: lduperval | last post by:
Hi, I`m trying to do date calculations in three types of time zones: local, GMT and specified. The issue I am facing is that I need to be able to specify a date in the proper time zone, and I`m...
3
by: Jon Davis | last post by:
The date string: "Thu, 17 Jul 2003 12:35:18 PST" The problem: // this fails on PST DateTime myDate = DateTime.Parse("Thu, 17 Jul 2003 12:35:18 PST"); Help? Jon
14
by: Jon Davis | last post by:
I have put my users through so much crap with this bug it is an absolute shame. I have a product that reads/writes RSS 2.0 documents, among other things. The RSS 2.0 spec mandates an en-US style...
17
by: Franc Zabkar | last post by:
My D-Link DSL-302G modem/router has a real-time clock whose settings are volatile. To avoid hand keying the date/time via the modem's JS interface, I wonder if there is a way to copy the JS code to...
7
by: David E. Ross | last post by:
My Web site is hosted by my ISP on an Apache server. Some of my pages display dynamic "Last Updated" dates by using the LAST_MODIFIED environment variable in the following SSI: <!--#config...
14
by: shapper | last post by:
Hello, Is there any function to convert a Date/Time from UTC to the user client zone and back from user client zone to UTC? I want to store Date/Time in UTC in the database but display it in...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.