|
| 1 | +--- |
| 2 | +id: set-date-time-hour-format-real-devices |
| 3 | +title: Set Custom Date, Time & Hour Format on Real Devices |
| 4 | +sidebar_label: Date & Time Settings |
| 5 | +description: Configure date, time, and hour-format on iOS and Android devices during manual and Appium-based automation testing on LambdaTest. |
| 6 | + |
| 7 | +keywords: |
| 8 | + - set device time iOS |
| 9 | + - change date mobile automation |
| 10 | + - iOS 12-hour format testing |
| 11 | + - real device date time change |
| 12 | + - Appium date override |
| 13 | + - LambdaTest date configuration |
| 14 | + - real device time simulation |
| 15 | + - app testing on real device |
| 16 | + - simulate date time |
| 17 | + - iOS automation hooks |
| 18 | +url: https://www.lambdatest.com/support/docs/set-date-time-hour-format-real-devices/ |
| 19 | +site_name: LambdaTest |
| 20 | +slug: set-date-time-hour-format-real-devices/ |
| 21 | +--- |
| 22 | +import CodeBlock from '@theme/CodeBlock'; |
| 23 | +import {YOUR_LAMBDATEST_USERNAME, YOUR_LAMBDATEST_ACCESS_KEY} from "@site/src/component/keys"; |
| 24 | + |
| 25 | +import Tabs from '@theme/Tabs'; |
| 26 | +import TabItem from '@theme/TabItem'; |
| 27 | + |
| 28 | +<script type="application/ld+json" |
| 29 | + dangerouslySetInnerHTML={{ __html: JSON.stringify({ |
| 30 | + "@context": "https://schema.org", |
| 31 | + "@type": "BreadcrumbList", |
| 32 | + "itemListElement": [{ |
| 33 | + "@type": "ListItem", |
| 34 | + "position": 1, |
| 35 | + "name": "Home", |
| 36 | + "item": "https://www.lambdatest.com" |
| 37 | + },{ |
| 38 | + "@type": "ListItem", |
| 39 | + "position": 2, |
| 40 | + "name": "Support", |
| 41 | + "item": "https://www.lambdatest.com/support/docs/" |
| 42 | + },{ |
| 43 | + "@type": "ListItem", |
| 44 | + "position": 3, |
| 45 | + "name": "Set Date and Time on Real Devices", |
| 46 | + "item": "https://www.lambdatest.com/support/docs/set-date-time-hour-format-real-devices/" |
| 47 | + }] |
| 48 | + }) }} |
| 49 | +></script> |
| 50 | + |
| 51 | + |
| 52 | +Testing applications often requires validation across different date, time, and format scenarios. LambdaTest now supports dynamic configuration of **date, time, 12/24-hour format**, and **automatic time toggle** on real iOS and Android devices — both in **manual** sessions and via **Appium automation hooks**. |
| 53 | + |
| 54 | +This enables use cases like testing scheduled alerts, AM/PM behaviors, time-bound features, and regional formatting validations. |
| 55 | + |
| 56 | +--- |
| 57 | + |
| 58 | +## Access Date & Time Settings on LambdaTest Real Devices |
| 59 | + |
| 60 | +**Step 1:** Log into your LambdaTest dashboard and navigate to **Real Devices** > **App Testing**. |
| 61 | + |
| 62 | +**Step 2:** Select your desired app and an iOS device (iOS 14+), then click **Start** to launch your session. |
| 63 | + |
| 64 | +**Step 3:** Once the session starts, open the **iOS Settings** tab in the left sidebar. |
| 65 | + |
| 66 | +**Step 4:** Click on **Set Date and Time** to open the configuration modal. |
| 67 | + |
| 68 | +<img loading="lazy" src={require('../assets/images/real-device-app-testing/set-date-and-time-pic1.png').default} className="doc_img"/> |
| 69 | + |
| 70 | +**Step 5:** In the **modal**, configure the **date**, **time**, and **time format** as needed, then click **Update** to apply the changes to the device. |
| 71 | + |
| 72 | +<img loading="lazy" src={require('../assets/images/real-device-app-testing/set-date-and-time-pic-last.png').default} className="doc_img"/> |
| 73 | + |
| 74 | + |
| 75 | +--- |
| 76 | + |
| 77 | +## Date & Time Configuration Options |
| 78 | + |
| 79 | +<img loading="lazy" src={require('../assets/images/real-device-app-testing/set-date-and-time-pic2.png').default} className="doc_img"/> |
| 80 | + |
| 81 | +The modal includes four options to simulate various datetime-related behaviors: |
| 82 | + |
| 83 | +### 1. Set Date and Time Automatically |
| 84 | +- **Toggle ON:** Syncs the device with network time. |
| 85 | +- **Toggle OFF:** Unlocks manual controls for custom configuration. |
| 86 | +- Disabling this is mandatory to manually edit date or time. |
| 87 | + |
| 88 | +<img loading="lazy" src={require('../assets/images/real-device-app-testing/set-date-and-time-pic4.png').default} className="doc_img"/> |
| 89 | + |
| 90 | + |
| 91 | +### 2. Date |
| 92 | +- Opens a calendar picker with selectable dates up to **7 days ahead**. |
| 93 | +- Selecting a date updates the system date on the device. |
| 94 | +- Past dates and dates beyond 7 days are **grayed out** and unselectable. |
| 95 | +- An **Apply** button appears only when a valid date is selected. |
| 96 | + |
| 97 | +<img loading="lazy" src={require('../assets/images/real-device-app-testing/set-date-and-time-pic3.png').default} className="doc_img"/> |
| 98 | + |
| 99 | + |
| 100 | +### 3. Time |
| 101 | +- Allows custom time entry in `HH:MM:SS` format. |
| 102 | +- Picker adjusts based on selected hour-format (12 or 24-hour). |
| 103 | +- Supports both **manual typing** and **arrow key navigation** for time input. |
| 104 | + |
| 105 | +### 4. Time Format (12/24 Hour) |
| 106 | +- Choose between **12-hour** (AM/PM toggle) and **24-hour** formats. |
| 107 | +- 12-hour format shows AM/PM option in time picker. |
| 108 | +- 24-hour format disables AM/PM selection automatically. |
| 109 | + |
| 110 | +<img loading="lazy" src={require('../assets/images/real-device-app-testing/set-date-and-time-pic-5.png').default} className="doc_img"/> |
| 111 | + |
| 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 | +--- |
| 135 | + |
| 136 | +## Supported Platforms: |
| 137 | + |
| 138 | +| Platform | Configuration Methods | OS Versions Supported | |
| 139 | +| -------- | --------------------------- | --------------------- | |
| 140 | +| iOS | Manual + Appium Executor | iOS 14 and above | |
| 141 | +| Android | Manual Only (No automation) | Android 10 and above | |
| 142 | + |
| 143 | + |
| 144 | +--- |
| 145 | + |
| 146 | +## Use Cases: |
| 147 | + |
| 148 | +- Test scheduled notifications and alerts |
| 149 | +- Validate time-sensitive app flows |
| 150 | +- Check 12/24-hour format compatibility |
| 151 | +- Simulate future or custom dates |
| 152 | +- Debug calendar and time-based modules |
| 153 | +- Verify auto/manual time toggle behavior |
| 154 | +- Test date/time edge cases (e.g., midnight, EOM) |
0 commit comments