Method: Appium::Core::Base::Driver#device_time

Defined in:
lib/appium_lib_core/common/base/driver.rb

#device_time(format = nil) ⇒ String

Get the time on the device

Examples:


@driver.device_time #=> "2018-06-12T11:13:31+02:00"
@driver.device_time "YYYY-MM-DD" #=> "2018-06-12"

Parameters:

  • (defaults to: nil)

    The set of format specifiers. Read momentjs.com/docs/ to get the full list of supported datetime format specifiers. The default format is YYYY-MM-DDTHH:mm:ssZ, which complies to ISO-8601

Returns:

  • Formatted datetime string or the raw command output if formatting fails



782
783
784
# File 'lib/appium_lib_core/common/base/driver.rb', line 782

def device_time(format = nil)
  @bridge.device_time(format)
end