0

I'm using an API result in my android project which includes the time of an event. The problem is that i am not getting the correct time to show to the whole world due to the usage of DST (Daylight saving Time) in some countries.

eg: Suppose from API i'm getting 14:20 (GMT +0.00 Time) , in an area which uses DST (for eg: Canada, GMT -4.00) The time should be shown 9.20 instead of 10.20 (i.e. one hour further back to actual time.) Meanwhile the other part of the world which does not uses DST must show the actual time (i.e. 10:20 )

Is there any method to solve this issue ?

Do anybody knows how to solve this issue ?

victorkt
  • 13,992
  • 9
  • 52
  • 51
Safvan 7
  • 395
  • 3
  • 12
  • 1
    Did you try doing an internet search for this? Android has APIs that you can use to query the timezone, determine if daylight savings is active, and get the daylight savings time offset from the regular timezone. Have a look at [this](http://developer.android.com/reference/java/util/SimpleTimeZone.html) and please post your code if you are having a specific problem with your implementation. – Aaron D Apr 02 '15 at 10:42

1 Answers1

0

i prefer assign a tag for country and its day light saving time.so each time API is called based on the country tag it will correct the time zone.

If not another way is track the user location and assign the DST to particular location.hope its use full have a nice day.

Get Location and assigning time zone

Community
  • 1
  • 1
Anburaj_N
  • 109
  • 1
  • 1
  • 10