Hi. Method driver.getDeviceTime() returns incorrectly time. It returns PC time, but not device time.
Usually, it not noticeable, because PC and connected device have one timezone. But I use Sause labs for testing and can’t get correctly device time.
This issue valid for Appium version above 1.7.2
For Appium 1.7.2 and below, driver.getDeviceTime() works correctly.
Appium log for getDeviceTime()
[2019-08-02 04:20:40][HTTP]
[2019-08-02 04:20:40][HTTP] --> GET /wd/hub/session/07c457c8-4292-44e8-93de-
f75c91b2d8e3/appium/device/system_time
[2019-08-02 04:20:40][HTTP] {}
[2019-08-02 04:20:40][W3C (07c457c8)] Calling AppiumDriver.getDeviceTime() with args:
[null,"07c457c8-4292-44e8-93de-f75c91b2d8e3"]
[2019-08-02 04:20:40][AndroidDriver] Attempting to capture android device date and time
[2019-08-02 04:20:40][ADB] Running '/Users/ysmirnova/Library/Android/sdk/platform-tools/adb -P
5037 -s 52000031f48c8431 shell date +%Y-%m-%dT%T%z'
[2019-08-02 04:20:40][W3C (07c457c8)] Responding to client with driver.getDeviceTime() result:
"2019-08-02T16:21:03+03:00"
[2019-08-02 04:20:40][HTTP] <-- GET /wd/hub/session/07c457c8-4292-44e8-93de-
f75c91b2d8e3/appium/device/system_time 200 99 ms - 37
[2019-08-02 04:20:40][HTTP]
Adb shell date console output
$ adb shell date
Fri Aug 2 20:24:08 +07 2019