Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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);
}
};