| isNanoseconds | boolean | No | Whether the time to return is in nanoseconds.<br>- **true**: The time to return is in nanoseconds.<br>- **false**: The time to return is in milliseconds.<br>Default value: **false**|
**Return value**
| Type | Description |
| ------ | -------------------------- |
| number | Time elapsed since the Unix epoch.|
**Example**
```js
try{
lettime=systemDateTime.getTime(true)
}catch(e){
console.info(`Failed to get time. message: ${e.message}, code: ${e.code}`);
}
```
## systemDateTime.getUptime<sup>10+</sup>
getUptime(timeType: TimeType, isNanoseconds?: boolean): number
Obtains the time elapsed since system startup. This API returns the result synchronously.
| timeType | [TimeType](#timetype10) | Yes | Type of the time to obtain. |
| isNanoseconds | boolean | No | Whether the time to return is in nanoseconds.<br>- **true**: The time to return is in nanoseconds.<br>- **false**: The time to return is in milliseconds.<br>Default value: **false**|
Sets the system date. This API uses an asynchronous callback to return the result.
> **NOTE**
>
> This API is supported since API version 9 and deprecated since API version 10. You are advised to use [systemDateTime.setTime](#systemdatetimesettime) instead.
Sets the system date. This API uses a promise to return the result.
> **NOTE**
>
> This API is supported since API version 9 and deprecated since API version 10. You are advised to use [systemDateTime.setTime](#systemdatetimesettime) instead.
Obtains the current system date. This API uses an asynchronous callback to return the result.
> **NOTE**
>
> This API is supported since API version 9 and deprecated since API version 10. You are advised to use **new Date()** instead, which returns a **Date** object.
Obtains the current system date. This API uses a promise to return the result.
> **NOTE**
>
> This API is supported since API version 9 and deprecated since API version 10. You are advised to use **new Date()** instead, which returns a **Date** object.
| builder | CustomDialog | Yes | Constructor of the custom dialog box content. |
| builder | CustomDialog | Yes | Builder of the custom dialog box content. |
| cancel | () => void | No | Callback invoked when the dialog box is closed after the overlay exits. |
| autoCancel | boolean | No | Whether to allow users to click the overlay to exit.<br>Default value: **true** |
| alignment | [DialogAlignment](ts-methods-alert-dialog-box.md#dialogalignment) | No | Alignment mode of the dialog box in the vertical direction.<br>Default value: **DialogAlignment.Default**|
| openAnimation<sup>10+</sup> | [AnimateParam](ts-explicit-animation.md#animateparam) | No | Parameters for defining the open animation of the dialog box.<br>**NOTE**<br>**iterations**: The default value is **1**, indicating that the animation is played once; any other value evaluates to the default value.<br>**playMode**: The default value is **PlayMode.Normal**; any other value evaluates to the default value.|
| closeAniamtion<sup>10+</sup> | [AnimateParam](ts-explicit-animation.md#animateparam) | No | Parameters for defining the close animation of the dialog box.<br>**NOTE**<br>**iterations**: The default value is **1**, indicating that the animation is played once; any other value evaluates to the default value.<br>**playMode**: The default value is **PlayMode.Normal**; any other value evaluates to the default value. |
| showInSubWindow<sup>10+</sup> | boolean | No | Whether to show the dialog box in a sub-window when the dialog box needs to be displayed outside the main window.<br>Default value: **false**, indicating that the dialog box is not displayed in the subwindow<br>**NOTE**<br>A dialog box whose **showInSubWindow** attribute is **true** cannot trigger the display of another dialog box whose **showInSubWindow** attribute is also **true**.|
| backgroundColor<sup>10+</sup> | [ResourceColor](ts-types.md#resourcecolor) | No | Background color of the dialog box.|
| backgroundColor<sup>10+</sup> | [ResourceColor](ts-types.md#resourcecolor) | No | Background color of the dialog box.<br>**NOTE**<br>If the content builder also has the background color set, the background color set here will be overridden by the background color of the content builder.|
| cornerRadius<sup>10+</sup> | [BorderRadiuses](ts-types.md#borderradiuses9)\|[Dimension](ts-types.md#dimension10) | No | Radius of the rounded corners of the background.<br>You can set separate radiuses for the four rounded corners.<br>Default value: **{ topLeft: '24vp', topRight: '24vp', bottomLeft: '24vp', bottomRight: '24vp' }**<br>**NOTE**<br>This attribute must be used together with the [borderRadius](ts-universal-attributes-border.md) attribute.|
## cl.time.1 Permission Verification Adding for setTime, setDate, and setTimezone
Added permission verification for the **setTime**, **setDate**, and **setTimezone** APIs for compliance with the OpenHarmony API specifications.
Specifically:
- To call the **setTime** API, the **ohos.permission.SET_TIME** permission is required.
- To call the **setDate** API, the **ohos.permission.SET_TIME** permission is required.
- To call the **setTimezone** API, the **ohos.permission.SET_TIME_ZONE** permission is required.
**Key API/Component Changes**
Involved APIs:
- systemDateTime.setTime;
- systemDateTime.setDate;
- systemDateTime.setTimezone;
Before change:
- No permission is required for calling the APIs in question.
After change:
- The APIs can be called only after the specific permission is obtained. If the permission request is invalid or the specific permission is not obtained, **201** is returned, indicating that permission verification fails.
**Adaptation Guide**
To call the **setTime**, **setDate**, and **setTimezone** APIs, an application must apply for the corresponding permission.