Set date/time using ADB shell

To save storage space Android like many other embedded systems uses multi-call binaries to implement its basic command line tools like date.

Android device may include either toolbox or toybox (or both) binary depending on the version. You can check which implementation of the date tool available on your device by running toolbox date and toybox date commands. Then you can use the one which prints out the current date. For example for an Android 6.0+ device it might look like:

$ adb shell toybox date
Mon Jul 31 21:09:28 CDT 2017

$ adb shell toolbox date
date: no such tool

To set date and time using toolbox date use YYYYMMDD.HHmmss format:

adb shell "su 0 toolbox date -s 20161231.235959"

In case of toybox date use MMDDhhmm[[CC]YY][.ss] format:

adb shell "su 0 toybox date 123123592016.59"

Leave a Comment