Android adb shell Set Date/Time via adb

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Example

6.0

Default SET format is MMDDhhmm[[CC]YY][.ss], that's (2 digits each)

For example, to set July 17'th 10:10am, without changing the current year, type:

adb shell 'date 07171010.00'

Tip 1: the date change will not be reflected immediately, and a noticable change will happen only after the system clock advances to the next minute.
You can force an update by attaching a TIME_SET intent broadcast to your call, like that:

adb shell 'date 07171010.00 ; am broadcast -a android.intent.action.TIME_SET'

Tip 2: to synchronize Android's clock with your local machine:

Linux:

adb shell date `date +%m%d%H%M%G.%S`

Windows (PowerShell):

$currentDate = Get-Date -Format "MMddHHmmyyyy.ss" # Android's preferred format
adb shell "date $currentDate"

Both tips together:

adb shell 'date `date +%m%d%H%M%G.%S` ; am broadcast -a android.intent.action.TIME_SET'
6.0

Default SET format is 'YYYYMMDD.HHmmss'

adb shell 'date -s 20160117.095930'

Tip: to synchronize Android's clock with your local (linux based) machine:

adb shell date -s `date +%G%m%d.%H%M%S`


Got any Android Question?