Hi,
I am creating a service that take Latitude and longitude and Timestamp as input and use GoogleAPI and send me correct timeZone. By using this timezone I am able to get the date and time for that lat long.
Its working fine but Now I am facing some problem that I am unable to resolve it.
My problem is Both Dubai and Qatar is at same TimeZone with different time. so when I calculate time as per TimeZone both are showing same time. So I need some solution for it.
What I have tried:
protected string getTimeZoneFroPaidApi(string latitude, string longitude, int TimeStamp)
{
string str = "";
try
{
XElement xelement = XElement.Load(string.Format("https://maps.googleapis.com/maps/api/timezone/xml?location={0},{1}×tamp={2}&key=*********", (object)latitude, (object)longitude, (object)TimeStamp));
str = !(xelement.Element((XName)"status").Value == "OK") ? "Error: " + xelement.Element((XName)"status").Value : string.Format("{0}", (object)xelement.Element((XName)"raw_offset").Value);
}
catch (Exception ex)
{
Logger.WriteLogWS(ex, "V2_SERVICE", "GET_TIME_ZONE");
}
return str;
}
It is a paid GoogleAPI and I have doubt why the third parameter is required. Now I am sending current Second from System date as third parameter.
How can I differentiate the time with same timezone.