Skip to content

Commit d31386f

Browse files
authored
Merge pull request LambdaTest#1713 from deepanshu-product/stage1
Add Documentation for Setting Device Date, Time & Hour Format in App Automation
2 parents 2f5f762 + 0f40236 commit d31386f

File tree

3 files changed

+133
-23
lines changed

3 files changed

+133
-23
lines changed

docs/appium-date-and-time.md

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
---
2+
id: appium-date-and-time
3+
title: Set Custom Date, Time & Hour Format on Real Devices
4+
hide_title: true
5+
sidebar_label: Set Date and Time
6+
description: This document provides information about configuring date, time, and hour-format on Real Devices using Appium automation on LambdaTest.
7+
keywords:
8+
- Appium
9+
- LambdaTest
10+
- Set Date and Time
11+
- Device Time Automation
12+
- 12-hour format
13+
- 24-hour format
14+
15+
url: https://www.lambdatest.com/support/docs/appium-date-and-time/
16+
site_name: LambdaTest
17+
slug: appium-date-and-time/
18+
---
19+
20+
21+
import CodeBlock from '@theme/CodeBlock';
22+
import {YOUR_LAMBDATEST_USERNAME, YOUR_LAMBDATEST_ACCESS_KEY} from "@site/src/component/keys";
23+
24+
import Tabs from '@theme/Tabs';
25+
import TabItem from '@theme/TabItem';
26+
27+
<script type="application/ld+json"
28+
dangerouslySetInnerHTML={{ __html: JSON.stringify({
29+
"@context": "https://schema.org",
30+
"@type": "BreadcrumbList",
31+
"itemListElement": [{
32+
"@type": "ListItem",
33+
"position": 1,
34+
"name": "Home",
35+
"item": "https://www.lambdatest.com"
36+
},{
37+
"@type": "ListItem",
38+
"position": 2,
39+
"name": "Support",
40+
"item": "https://www.lambdatest.com/support/docs/"
41+
},{
42+
"@type": "ListItem",
43+
"position": 3,
44+
"name": "Set Custom Date, Time & Hour Format on Real Devices",
45+
"item": "https://www.lambdatest.com/support/docs/appium-date-and-time/"
46+
}]
47+
})
48+
}}
49+
></script>
50+
51+
# Set Device Date & Time
52+
53+
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.
54+
55+
By the end of this document, you will be able to:
56+
- Set a specific date and time on the device
57+
- Toggle between 12-hour and 24-hour formats
58+
- Enable/disable automatic time syncing with network settings
59+
60+
---
61+
62+
## Support for Automation on Real Devices
63+
64+
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.
65+
66+
### Appium Hook Example
67+
68+
<CodeBlock language="js">
69+
{`driver.execute_script('lambda_executor: {
70+
"action": "updateDeviceSettings",
71+
"arguments": {
72+
"customDate": "Jun 20 2025",
73+
"customTime": "15:05",
74+
"twelveHourTime": "On",
75+
"setAutomatically": "On"
76+
}
77+
}')`}
78+
</CodeBlock>
79+
80+
81+
---
82+
## Supported Arguments
83+
84+
| Argument | Format | Description |
85+
| ------------------ | ------------- | --------------------------------------------------------------------------- |
86+
| `customDate` | `MMM DD YYYY` | Sets device date. Max 7 days from today. |
87+
| `customTime` | `HH:MM` | Time in 24-hour format (e.g., 13:30). Interpreted based on `twelveHourTime`.|
88+
| `twelveHourTime` | `On` / `Off` | `On` for 12-hour, `Off` for 24-hour format. |
89+
| `setAutomatically` | `On` / `Off` | Enables or disables syncing with network time. |
90+
91+
> 💡 **Note:** When `setAutomatically` is turned **On**, manual inputs for date and time are disabled on the device.
92+
93+
---
94+
## Supported Platforms
95+
96+
| Platform | OS Version | Support Status |
97+
| --------- | ------------- | ------------------------------- |
98+
| iOS | 14 and above | ✅ Fully Supported |
99+
| Android | 10 and above | ⚠️ Manual: Supported🔧 Automation: In Progress |
100+
101+
---
102+
103+
## Example Use Cases
104+
105+
- Validate how the app behaves across different time zones or locales.
106+
- Test reminder or calendar event triggering logic.
107+
- Test 12-hour vs. 24-hour format layout rendering.
108+
109+
110+
> **Note:** For configuring device date and time during **manual testing** on real devices, please refer to our [Set Date & Time on Real Devices (Manual)](support/docs/set-date-time-hour-format-real-devices/) guide.
111+
112+
113+
114+
<nav aria-label="breadcrumbs">
115+
<ul className="breadcrumbs">
116+
<li className="breadcrumbs__item">
117+
<a className="breadcrumbs__link" target="_self" href="https://www.lambdatest.com">
118+
Home
119+
</a>
120+
</li>
121+
<li className="breadcrumbs__item">
122+
<a className="breadcrumbs__link" target="_self" href="https://www.lambdatest.com/support/docs/">
123+
Support
124+
</a>
125+
</li>
126+
<li className="breadcrumbs__item breadcrumbs__item--active">
127+
<span className="breadcrumbs__link">
128+
IP Geolocation
129+
</span>
130+
</li>
131+
</ul>
132+
</nav>

docs/real-device-custom-date-and-time.md

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -109,29 +109,6 @@ The modal includes four options to simulate various datetime-related behaviors:
109109

110110
<img loading="lazy" src={require('../assets/images/real-device-app-testing/set-date-and-time-pic-5.png').default} className="doc_img"/>
111111

112-
---
113-
114-
## Configure Date & Time via Appium
115-
116-
You can configure date, time, time format (12h/24h), and toggle automatic syncing via a LambdaTest custom Appium executor hook.
117-
118-
### Appium Hook:
119-
120-
```js
121-
lambda_executor: { "action": "updateDeviceSettings", "arguments": { "customDate": "Jun 20 2025", "customTime": "15:05", "twelveHourTime": "On", "setAutomatically": "On" } }
122-
```
123-
124-
125-
### Appium Hook:
126-
127-
| Argument | Format | Description |
128-
| ------------------ | ------------- | ---------------------------------------------------------------------------- |
129-
| `customDate` | `MMM DD YYYY` | Future-only date. Max 7 days from current date. |
130-
| `customTime` | `HH:MM` | Time in 24-hour format. Interpreted based on selected hour format. |
131-
| `twelveHourTime` | `On` / `Off` | Toggles between 12-hour (`On`) and 24-hour (`Off`) formats. |
132-
| `setAutomatically` | `On` / `Off` | Enables or disables syncing time with network. Disabling allows manual edit. |
133-
134-
---
135112

136113
## Supported Platforms:
137114

sidebars.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2724,6 +2724,7 @@ module.exports = {
27242724
"appium-custom-header",
27252725
"basic-authentication-for-web-automation",
27262726
"live-debug-in-app-automation",
2727+
"appium-date-and-time",
27272728
],
27282729
},
27292730
{

0 commit comments

Comments
 (0)