This object is in archive! 

Sunrise and sunset doesn't work in different timezones

Martin Major shared this problem 7 years ago
Solved

Hi,

When I look at weather panel from some distant timezone, the sunrise and sunset times are wrong. It might be intentional to show them in my current local time (I would find more useful to show them in their local time though) but sunrise time shows "-5:0-42") which is definitely wrong :)

Replies (3)

photo
1

Good day Martin,

funny time -5:0:-42 indeed :). Locus display sunrise/sunset times in your current timezone, but values are in this case for location "Arthur's pass" defined at top of screen. So I believe that values are correct, they are just not in timezone of "Arthur's pass" , but in your own current timezone.

Converting value to target timezone should be quite complicated task, which I'm not sure it's worth it to be true.

photo
1

Hi Menion,


I agree, that timezones are hell :) In that case, wouldn't be easier to display those times in their local timezone so you wouldn't need convert anything?


My usecase is: when I need sunrise time for some place, I need to know it, because I'll be there. That means that I need it in their current timezone. And if I plan something ahead, I might be currently in different timezone right know, but still need to know it in their timezone.


That being said, I think it is easier and more useful not to try convert those times :)

photo
1

Hello,

problem here is that I do not convert any times into your current local timezone. Without knowing timezone of place where you wants to know sunset/sunrise, it's not possible to get correct times. Fortunately I've found small library for Android that may be used here. I use worst possible version that gives accuracy around 50 km, so on borders of timezone should be incorrect value +- 1 hour, but hope this won't be so bad. Library is small and fast so well usable for app like Locus.


So consider this as solved, thank you. If there will be any problem with this in next version, please let me know.

Replies have been locked on this page!