Can 开发者_JAVA技巧any one give me the code of web service (.asmx) for generating Time and date of a city, if I enter the name of a city in any part of the word..
Means in the web service consuming side.. say a Windows application I am reading the name of the city and I am sending it in to web service
I doubt that anyone would just hand you the code for it, but you can write it yourself.
The hardest part is getting a list of all cities and what time zone they are in. Once you have identified the city and got it's time zone, the rest is easy:
DateTimeOffset time = new DateTimeOffset(DateTime.UtcNow, TimeSpan.Zero);
time = time.ToOffset(offsetOfTheCity);
精彩评论