7

I would like to be able to turn the automatic date time settings on and off from tasker. I don't see a way to do this directly but I can use tasker to issue a shell command. I know I can just use the date command to change the date to some specific date but is there a way to turn the automatic setting off and on from a command line or tasker?

  • If your problem is incorrect DST info - you can just update timezone database. – Penguinolog Jun 21 '13 at 10:33
3
+50

It might be useful to check the android source to find the exact package name to the system settings, specifically this source responsible for date/time, line 226 is the key!

Have played with tasker before, but can tasker directly modify system properties? as in directly do this, I am quoting line 228 the pertinent part:

Settings.Global.putInt(
        getContentResolver(), 
        Settings.Global.AUTO_TIME_ZONE, 
        autoZoneEnabled ? 1 : 0);

In short the actual direct name to the package would be com.android.settings/.DateTimeSettings, if that's of any help!

By using adb shell's Android Activity Manager, am, one can start the activity to go directly into that screen as in am start -n com.android.settings/.DateTimeSettings, experiment and see if that fits your needs as I have not actually played with it. :)

| improve this answer | |
  • There is also a Settings.Global.AUTO_TIME settings that you can also disable for auto date & time. – Chef Pharaoh Sep 5 '17 at 14:45
6

turn on:

settings put global auto_time 1

turn off:

settings put global auto_time 0

source: Android sourcecode

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.