I am currently creating application which requires Current Time From the Country.
I have latitude and longitude of different Country.
I have use following Link to get the Current Time
http://api.geonames.org/timezone?lat=21.7679&lng=78.8718&username=demo
(demo user name is by default and used only for testing because it has query limit)
I got the current Time but when Daylight Saving Time is ON. Is that API gives me the correct Time? If not then how could i get the current Time.
In some of the API I get the current time like earthtool(not implemented DST). But i could not Test because currently there is no DST Implemented so how can i test in this case?
I am Creating Application in .NET with C# 4.0
If any other API then please Tell Me but first priority to GeoNames API.
I would be very surprised if that didn’t reflect the current local time. The results for Sao Paolo (which is currently observing DST) seem to agree with that:
However, another alternative would be to use the GeoNames API to get the time zone ID, and then use Noda Time for everything to do with that time zone. (Disclaimer: I’m the primary developer of Noda Time.)
You can’t just use the BCL’s
TimeZoneInfoclass directly, as that doesn’t support TZDB the time zone IDs that GeoNames provides (e.g. “Asia/Kolkata”). You could just use a mapping (CLDR provides one) but in my experience the Windows time zone information has some disturbing oddities.If you just need to know the current time, GeoNames is probably fine –