开发者

Time Zones of different Countries

I am creating a web site which in which the service providers can create their schedule (date and time) at which they can provide service and client can book them. but the problem is that service providers are from different countries. so their is Time zone problem. please give me a solution for it, that I should convert the time of service providers (while inserting schedule) to GMT in javascript (client side) or in my CS file (server side) how to manage all this? How to handle time zones properly? If I converts it at client side then problem is that maybe client have set wrong time zone on his pc... and if I convert it at ser开发者_StackOverflow中文版ver side.. than how to manage .. how to show it to service providers their schedule and to clients accordingly? I am using asp.net (VS 2005) and sql server.


Save times in GMT, as it does not suffer from daylight savings issues. Convert to and from this saved time to the timezone of the client.

See this SO question (Daylight saving time - do and don’ts) for lots of pointers and resources.


Good question, I have been thinking about this too:

Work out the users timezone offset in javascript and use this to:

1) Save alongside a GMT/UTC date in the database (probably too much overhead) 2) To create a DateTimeOffset which saved to the database as a DateTimeOffset Type in SQL SERVER 2008, a better solution I think.

This means you know the Date and the timezone it was saved in.

Then display a calculated date based on the users Date Format and Timezone preference?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜