tags:

views:

60

answers:

1

Can 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

+1  A: 

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);
Guffa
i am a begginner,,i think that code is simple,,if any URL are available for adding webreference then fwd
peter
What is it that you have problems with, really? Is it making the web service or using it?
Guffa