• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Advance clock 2 hours ahead automatically at a specific time

fdorian88

Lurker
I think what im trying to do is less common. At a specific time of day, I want the time to move ahead by X hours, then at a later time, back to the original time. I can do this on a pc using a python script. How can I do it on a phone? I tried using a vpn, changing the geographical location of the ip and hope the phone would automatically detect that time zone, but it doesn't. Any ideas? Thanks!
 
When you take into consideration how your phone updates its time that might help you find a solution to your query. Periodically and regularly a script runs to sync your phone's day/date/time service to some preset online time server, essentially similar to how your PC updates itself. Using a VPN alters online connectivity so yeah, you can predetermine the time based on its locale-based IP address, but that's not the sole issue to consider. Those online time servers are all maintaining UTC (Universal Coordinated Time), the exact time that's supplied by an atomic clock in Greenwich, U.K. All our PCs and mobile devices then sync themselves to UTC, with their respective operating systems all converting the UTC day/date/time to whichever is appropriate for all our particular locations. So when your phone is connected online via a VPN, it's the same UTC there as where your standing -- it's your phone you need to look into, not the external influences that are involved.
Try using what @Dannydet suggested, the Tasker app is quite capable doing what its designed to do.

In your instance, you'll need to set up a routine to open up Settings, go the System settings menu, open the Date & time menu, disable Set time automatically, disable Set time zone automatically, then manually bump the time two hours ahead (that step will be be the trickiest to do). Depending on your phone, it may vary on how your Settings menu is arranged. You'll need to set up a second less involved routine to just enable Set time automatically and Set time zone automatically again so your phone will start re-syncing itself again.
The Tasker app it's just an app you install from the Play Store and it will just be using the same Settings app you interact with. If you opt to set up your own crafted Python script, your phone will need to be rooted as you're going to need to disable and alter integral time updating services that automatically run at system-level.
 
Back
Top Bottom