jon
jon

Reputation: 31

How to get clients Time zone

Im running into a lil problem here, i need to get the clients time zone off the browser since the time on his side that he specifies for scheduling is different to the server time. Its a silverlight application, and yeah cant really use javascript to try and get the timezone offset and save it as a cookie. Cant really use the culture info to grab the information to check which country they live in since some could have not set the browser language and still be using english-us so its not 100 perc correct. Have looked in to the timezoneinfo class but that seems to only give the time zone of the server and not the client. Is there any way i can extract the time zone of the client without asking the user for it?

Thanks in advance, Michelle

Upvotes: 1

Views: 682

Answers (2)

Ioana Marcu
Ioana Marcu

Reputation: 551

In case anyone encounters this issue, DateTime.Now in Silverlight is client time. No need for JavaScript or other gimmicks.

Upvotes: 1

anothershrubery
anothershrubery

Reputation: 21003

Can you not use TimeZoneInfo? See here.

EDIT: Nope. Disregard this, don't know why I missed this in the question. Without the use of javascript I can't think of a way to do this.

Upvotes: 0

Related Questions