Hey everyone!
Background: I recently moved to Queensland (Australia) which doesn't have daylight savings like the southern states (where I'm from) do. Consequently, during summer the sun comes up at the ungodly hour of 4:45am or thereabouts.
It got me thinking, would it be possible to design an app which each night modifies the user's time zone (ever so slightly) such that each day, the sun rises at the same time (ie 6am)?
Thinking mainly for Android initially and maybe also Windows. My initial googling indicated it would be very difficult if not impossible, but then I came across
https://developer.android.com/reference/kotlin/java/util/TimeZone and thought that if Android's own documentation refers to custom time zones, it must be possible on some level?
I guess from a high level, the 3 major aspects are that any app or code would need to:
- Access the device's current location on a (reasonably) regular basis;
- Be able to access the current sunrise time for that particular location (or perhaps the next day's sunrise time if sunset has already occurred in that location)
- Be able to set the device's time zone to a custom time zone (GMT+10:47 for example), and modify that custom time zone regularly (daily ideally)
I've been fiddling around with DateTime and SetTimeZone, but the comments in B4A mentions that the device's default settings remain unchanged, when I guess that is really what I want.
Any thoughts?