I am programming an application that should give the local time based on the coordinates (lat&long) that you give it.
I only know of 2 methods to do that:
1st: Get the TimeZone Name, and then find its local time.
2nd: Use the Google API and receive the time as an offset and UTC not Local.
I decided to use the 1st method because seemed easier, so I decided to use the GeoTimeZone to get the Time Zone... Problem is that then I don′t know how to get the local time on that TimeZone... Here′s the code I wrote to get the TimeZone name.
string tz = TimeZoneLookup.GetTimeZone(lat, lon).Result;
variables lat
& lon
are of course the coordinates.
Thank you!
Edit: My question is how can I get the LocalTime on that TimeZone?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…