Skip to main content

Set Device Date & Time

LambdaTest now supports configuring custom date, time, and hour-format on Real Devices via Appium during automation testing sessions. This allows developers and testers to simulate specific date/time conditions to validate use cases like scheduled events, alarms, chats, or localization for time formats.

By the end of this document, you will be able to:

  • Set a specific date and time on the device
  • Toggle between 12-hour and 24-hour formats
  • Enable/disable automatic time syncing with network settings

Support for Automation on Real Devices

To modify the date and time settings programmatically, use the lambda_executor Appium hook with the updateDeviceSettings action. You can provide multiple arguments including custom date, time, format toggle, and auto-time setting.


Supported Arguments

ArgumentFormatDescription
customDateMMM DD YYYYSets the device date. You can select a date up to 7 days from today.
customTimeHH:MMSets time in 24-hour format (e.g., 13:30). Display adapts based on twelveHourTime (shown as 1:30 PM if enabled).
twelveHourTimeOn / OffOn for 12-hour, Off for 24-hour format.
setAutomaticallyOn / OffEnables or disables syncing with network time.

💡 Note: When setAutomatically is turned On, all Other Arguments for Date and Time are automatically disabled on the device.


Appium Hook Example

driver.execute_script('lambda_executor: { 
"action": "updateDeviceSettings",
"arguments": {
"customDate": "Jun 20 2025",
"customTime": "15:05",
"twelveHourTime": "On",
"setAutomatically": "On"
}
}')

Supported Platforms

PlatformOS VersionSupport Status
iOS14 and aboveFully Supported
note

This feature is currently not supported on Android. Support for Android is planned in a future update.


Example Use Cases

  • Validate how the app behaves across different time zones or locales.
  • Test reminder or calendar event triggering logic.
  • Test 12-hour vs. 24-hour format layout rendering.

For Configuring Device Date and Time during Manual Testing on Real Devices, please refer to our Set Date & Time on Real Devices (Manual) guide.

Test across 3000+ combinations of browsers, real devices & OS.

Book Demo

Help and Support

Related Articles