Possible Duplicate:
Web service – current time zone for a city?
Just wondering whether there is a public web service (without reading from local machine time zone) that I could use to get the current date-time in that city using C#.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use GeoNames to get the time zone. From that and the current UTC time, you can work out the local time. (You can also download the GeoNames data to avoid having to make a remote call.)
Note that GeoNames uses the Olson time zone names – there are various mappings from those to Windows time zone names around on the net for use with
TimeZoneInfo, or (plug) you could use Noda Time to perform the UTC to local time conversion. While there are aspects of Noda Time which are unfinished, that part should work fine.