How to use the appium-ios-device.utilities.getDeviceTime function in appium-ios-device

To help you get started, we’ve selected a few appium-ios-device examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github appium / appium-xcuitest-driver / lib / commands / general.js View on Github external
commands.getDeviceTime = async function getDeviceTime (format = MOMENT_FORMAT_ISO8601) {
  log.info('Attempting to capture iOS device date and time');
  if (this.isRealDevice()) {
    const { timestamp, utcOffset } = await utilities.getDeviceTime(this.opts.udid);
    return moment.unix(timestamp).utcOffset(utcOffset).format(format);
  } else {
    return await iosCommands.general.getDeviceTime.call(this, format);
  }
};