MCPcopy
hub / github.com/appium/python-client / device_time

Method device_time

appium/webdriver/extensions/device_time.py:28–39  ·  view source on GitHub ↗

Returns the date and time from the device. Return: str: The date and time

(self)

Source from the content-addressed store, hash-verified

26class DeviceTime(CanExecuteCommands, CanExecuteScripts, CanRememberExtensionPresence):
27 @property
28 def device_time(self) -> str:
29 """Returns the date and time from the device.
30
31 Return:
32 str: The date and time
33 """
34 ext_name = 'mobile: getDeviceTime'
35 try:
36 return self.assert_extension_exists(ext_name).execute_script(ext_name)
37 except UnknownMethodException:
38 # TODO: Remove the fallback
39 return self.mark_extension_absence(ext_name).execute(Command.GET_DEVICE_TIME_GET, {})['value']
40
41 def get_device_time(self, format: Optional[str] = None) -> str:
42 """Returns the date and time from the device.

Callers

nothing calls this directly

Calls 4

execute_scriptMethod · 0.80
executeMethod · 0.45

Tested by

no test coverage detected