From c00f215f99e477c05db01c0d9e094683d55be84a Mon Sep 17 00:00:00 2001 From: "ester.zhou" Date: Thu, 19 Jan 2023 19:33:45 +0800 Subject: [PATCH] Update docs (13519) Signed-off-by: ester.zhou --- .../reference/apis/js-apis-system-time.md | 438 ++++++++++++------ .../reference/errorcodes/Readme-EN.md | 2 + .../reference/errorcodes/errorcode-time.md | 25 + 3 files changed, 322 insertions(+), 143 deletions(-) create mode 100644 en/application-dev/reference/errorcodes/errorcode-time.md diff --git a/en/application-dev/reference/apis/js-apis-system-time.md b/en/application-dev/reference/apis/js-apis-system-time.md index a1876af97b..c8e93e0f8b 100644 --- a/en/application-dev/reference/apis/js-apis-system-time.md +++ b/en/application-dev/reference/apis/js-apis-system-time.md @@ -1,4 +1,4 @@ -# @ohos.systemTime +# @ohos.systemTime (System Time and Time Zone) The **systemTime** module provides system time and time zone features. You can use the APIs of this module to set and obtain the system time and time zone. @@ -29,21 +29,29 @@ Sets the system time. This API uses an asynchronous callback to return the resul | time | number | Yes | Timestamp to set, in milliseconds. | | callback | AsyncCallback<void> | Yes | Callback used to return the result.| +**Error codes** + +For details about the error codes, see [Time and Time Zone Service Error Codes](../errorcodes/errorcode-time.md). + +| ID| Error Message | +| -------- | ------------------------------------------------------------ | +| -1 | The parameter check failed or permission denied or system error. | + **Example** ```js // Set the system time to 2021-01-20 02:36:25. let time = 1611081385000; try { - systemTime.setTime(time, (error) => { - if (error) { - console.info(`Failed to setting time. message:${error.message}, code:${error.code}`); - return; - } - console.info(`Succeeded in setting time`); - }); + systemTime.setTime(time, (error) => { + if (error) { + console.info(`Failed to setting time. message: ${error.message}, code: ${error.code}`); + return; + } + }console.info(`Succeeded in setting time`); + }); } catch(e) { - console.info(`Failed to set time. message:${e.message}, code:${e.code}`); + console.info(`Failed to set time. message: ${e.message}, code: ${e.code}`); } ``` @@ -69,19 +77,27 @@ Sets the system time. This API uses a promise to return the result. | ------------------- | ------------------------- | | Promise<void> | Promise that returns no value.| +**Error codes** + +For details about the error codes, see [Time and Time Zone Service Error Codes](../errorcodes/errorcode-time.md). + +| ID| Error Message | +| -------- | ------------------------------------------------------------ | +| -1 | The parameter check failed or permission denied or system error. | + **Example** ```js // Set the system time to 2021-01-20 02:36:25. let time = 1611081385000; try { - systemTime.setTime(time).then(() => { - console.info(`Succeeded in setting time.`); - }).catch((error) => { - console.info(`Failed to setting time. message:${error.message}, code:${error.code}`); - }); + systemTime.setTime(time).then(() => { + console.info(`Succeeded in setting time.`); + }).catch((error) => { + console.info(`Failed to setting time. message: ${error.message}, code: ${error.code}`); + }); } catch(e) { - console.info(`Failed to set time. message:${e.message}, code:${e.code}`); + console.info(`Failed to set time. message: ${e.message}, code: ${e.code}`); } ``` @@ -101,22 +117,30 @@ Obtains the time elapsed since the Unix epoch. This API uses an asynchronous cal | Name | Type | Mandatory| Description | | -------- | -------------- | ---- | ------------------ | -| isNano | boolean | Yes | Whether the time to return is in nanoseconds.
- **true**: in nanoseconds (ns).
- **false**: in milliseconds (ms).| +| isNano | boolean | Yes | Whether the time to return is in nanoseconds.
- **true**: in nanoseconds.
- **false**: in milliseconds.| | callback | AsyncCallback<number> | Yes | Callback used to return the time elapsed since the Unix epoch. | +**Error codes** + +For details about the error codes, see [Time and Time Zone Service Error Codes](../errorcodes/errorcode-time.md). + +| ID| Error Message | +| -------- | ------------------------------------------- | +| -1 | The parameter check failed or system error. | + **Example** ```js try { - systemTime.getCurrentTime(true, (error, time) => { - if (error) { - console.info(`Failed to getting currentTime. message:${error.message}, code:${error.code}`); - return; - } - console.info(`Succeeded in getting currentTime : ${time}`); - }); + systemTime.getCurrentTime(true, (error, time) => { + if (error) { + console.info(`Failed to getting currentTime. message: ${error.message}, code: ${error.code}`); + return; + } + console.info(`Succeeded in getting currentTime: ${time}`); + }); } catch(e) { - console.info(`Failed to get currentTime. message:${e.message}, code:${e.code}`); + console.info(`Failed to get currentTime. message: ${e.message}, code: ${e.code}`); } ``` @@ -138,19 +162,27 @@ Obtains the time elapsed since the Unix epoch. This API uses an asynchronous cal | -------- | ----------- | ---- | ---------------------------------- | | callback | AsyncCallback<number> | Yes | Callback used to return the time elapsed since the Unix epoch. | +**Error codes** + +For details about the error codes, see [Time and Time Zone Service Error Codes](../errorcodes/errorcode-time.md). + +| ID| Error Message | +| -------- | ------------------------------------------- | +| -1 | The parameter check failed or system error. | + **Example** ```js try { - systemTime.getCurrentTime((error, time) => { - if (error) { - console.info(`Failed to getting currentTime. message:${error.message}, code:${error.code}`); - return; - } - console.info(`Succeeded in getting currentTime : ${time}`); - }); + systemTime.getCurrentTime((error, time) => { + if (error) { + console.info(`Failed to getting currentTime. message: ${error.message}, code: ${error.code}`); + return; + } + console.info(`Succeeded in getting currentTime : ${time}`); + }); } catch(e) { - console.info(`Failed to get currentTime. message:${e.message}, code:${e.code}`); + console.info(`Failed to get currentTime. message: ${e.message}, code: ${e.code}`); } ``` @@ -170,7 +202,7 @@ Obtains the time elapsed since the Unix epoch. This API uses a promise to return | Name| Type | Mandatory| Description | | ------ | ------- | ---- | ------------------------- | -| isNano | boolean | No | Whether the time to return is in nanoseconds.
- **true**: in nanoseconds (ns).
- **false**: in milliseconds (ms).| +| isNano | boolean | No | Whether the time to return is in nanoseconds.
- **true**: in nanoseconds.
- **false**: in milliseconds.| **Return value** @@ -178,17 +210,25 @@ Obtains the time elapsed since the Unix epoch. This API uses a promise to return | --------------------- | --------------------------- | | Promise<number> | Promise used to return the time elapsed since the Unix epoch.| +**Error codes** + +For details about the error codes, see [Time and Time Zone Service Error Codes](../errorcodes/errorcode-time.md). + +| ID| Error Message | +| -------- | ------------------------------------------- | +| -1 | The parameter check failed or system error. | + **Example** ```js try { - systemTime.getCurrentTime().then((time) => { - console.info(`Succeeded in getting currentTime : ${time}`); - }).catch((error) => { - console.info(`Failed to getting currentTime. message:${error.message}, code:${error.code}`); - }); + systemTime.getCurrentTime().then((time) => { + console.info(`Succeeded in getting currentTime : ${time}`); + }).catch((error) => { + console.info(`Failed to getting currentTime. message: ${error.message}, code: ${error.code}`); + }); } catch(e) { - console.info(`Failed to get currentTime. message:${e.message}, code:${e.code}`); + console.info(`Failed to get currentTime. message: ${e.message}, code: ${e.code}`); } ``` @@ -208,22 +248,30 @@ Obtains the time elapsed since system startup, excluding the deep sleep time. Th | Name | Type | Mandatory| Description | | -------- | ---------- | ---- | -------------------------- | -| isNano | boolean | Yes | Whether the time to return is in nanoseconds.
- **true**: in nanoseconds (ns).
- **false**: in milliseconds (ms).| +| isNano | boolean | Yes | Whether the time to return is in nanoseconds.
- **true**: in nanoseconds.
- **false**: in milliseconds.| | callback | AsyncCallback<number> | Yes | Callback used to return the time.| +**Error codes** + +For details about the error codes, see [Time and Time Zone Service Error Codes](../errorcodes/errorcode-time.md). + +| ID| Error Message | +| -------- | ------------------------------------------- | +| -1 | The parameter check failed or system error. | + **Example** ```js try { - systemTime.getRealActiveTime(true, (error, time) => { - if (error) { - console.info(`Failed to getting real active time. message:${error.message}, code:${error.code}`); - return; - } - console.info(`Succeeded in getting real active time : ${time}`); - }); + systemTime.getRealActiveTime(true, (error, time) => { + if (error) { + console.info(`Failed to getting real active time. message: ${error.message}, code: ${error.code}`); + return; + } + console.info(`Succeeded in getting real active time : ${time}`); + }); } catch(e) { - console.info(`Failed to get real active time. message:${e.message}, code:${e.code}`); + console.info(`Failed to get real active time. message: ${e.message}, code: ${e.code}`); } ``` @@ -245,19 +293,27 @@ Obtains the time elapsed since system startup, excluding the deep sleep time. Th | -------- | -------------- | ---- | --------------------- | | callback | AsyncCallback<number> | Yes | Callback used to return the time.| +**Error codes** + +For details about the error codes, see [Time and Time Zone Service Error Codes](../errorcodes/errorcode-time.md). + +| ID| Error Message | +| -------- | ------------------------------------------- | +| -1 | The parameter check failed or system error. | + **Example** ```js try { - systemTime.getRealActiveTime((error, time) => { - if (error) { - console.info(`Failed to getting real active time. message:${error.message}, code:${error.code}`); - return; - } - console.info(`Succeeded in getting real active time : ${time}`); - }); + systemTime.getRealActiveTime((error, time) => { + if (error) { + console.info(`Failed to getting real active time. message: ${error.message}, code: ${error.code}`); + return; + } + console.info(`Succeeded in getting real active time : ${time}`); + }); } catch(e) { - console.info(`Failed to get real active time. message:${e.message}, code:${e.code}`); + console.info(`Failed to get real active time. message: ${e.message}, code: ${e.code}`); } ``` @@ -277,7 +333,7 @@ Obtains the time elapsed since system startup, excluding the deep sleep time. Th | Name| Type | Mandatory| Description | | ------ | ------- | ---- | ----------------------------------- | -| isNano | boolean | No | Whether the time to return is in nanoseconds.
- **true**: in nanoseconds (ns).
- **false**: in milliseconds (ms).| +| isNano | boolean | No | Whether the time to return is in nanoseconds.
- **true**: in nanoseconds.
- **false**: in milliseconds.| **Return value** @@ -285,17 +341,25 @@ Obtains the time elapsed since system startup, excluding the deep sleep time. Th | -------------- | -------------------------------- | | Promise<number> | Promise used to return the time elapsed since system startup, excluding the deep sleep time.| +**Error codes** + +For details about the error codes, see [Time and Time Zone Service Error Codes](../errorcodes/errorcode-time.md). + +| ID| Error Message | +| -------- | ------------------------------------------- | +| -1 | The parameter check failed or system error. | + **Example** ```js try { - systemTime.getRealActiveTime().then((time) => { - console.info(`Succeeded in getting real active time : ${time}`); - }).catch((error) => { - console.info(`Failed to getting real active time. message:${error.message}, code:${error.code}`); - }); + systemTime.getRealActiveTime().then((time) => { + console.info(`Succeeded in getting real active time : ${time}`); + }).catch((error) => { + console.info(`Failed to getting real active time. message: ${error.message}, code: ${error.code}`); + }); } catch(e) { - console.info(`Failed to get real active time. message:${e.message}, code:${e.code}`); + console.info(`Failed to get real active time. message: ${e.message}, code: ${e.code}`); } ``` @@ -315,22 +379,30 @@ Obtains the time elapsed since system startup, including the deep sleep time. Th | Name | Type | Mandatory| Description | | -------- | --------------- | ---- | ------------------------------- | -| isNano | boolean | Yes | Whether the time to return is in nanoseconds.
- **true**: in nanoseconds (ns).
- **false**: in milliseconds (ms).| +| isNano | boolean | Yes | Whether the time to return is in nanoseconds.
- **true**: in nanoseconds.
- **false**: in milliseconds.| | callback | AsyncCallback<number> | Yes | Callback used to return the time. | +**Error codes** + +For details about the error codes, see [Time and Time Zone Service Error Codes](../errorcodes/errorcode-time.md). + +| ID| Error Message | +| -------- | ------------------------------------------- | +| -1 | The parameter check failed or system error. | + **Example** ```js try { - systemTime.getRealTime(true, (error, time) => { - if (error) { - console.info(`Failed to getting real time. message:${error.message}, code:${error.code}`); - return; - } - console.info(`Succeeded in getting real time : ${time}`); - }); + systemTime.getRealTime(true, (error, time) => { + if (error) { + console.info(`Failed to getting real time. message: ${error.message}, code: ${error.code}`); + return; + } + console.info(`Succeeded in getting real time : ${time}`); + }); } catch(e) { - console.info(`Failed to get real time. message:${e.message}, code:${e.code}`); + console.info(`Failed to get real time. message: ${e.message}, code: ${e.code}`); } ``` @@ -352,19 +424,27 @@ Obtains the time elapsed since system startup, including the deep sleep time. Th | -------- | --------- | ---- | --------------------------- | | callback | AsyncCallback<number> | Yes | Callback used to return the time. | +**Error codes** + +For details about the error codes, see [Time and Time Zone Service Error Codes](../errorcodes/errorcode-time.md). + +| ID| Error Message | +| -------- | ------------------------------------------- | +| -1 | The parameter check failed or system error. | + **Example** ```js try { - systemTime.getRealTime((error, time) => { - if (error) { - console.info(`Failed to getting real time. message:${error.message}, code:${error.code}`); - return; - } - console.info(`Succeeded in getting real time : ${time}`); - }); + systemTime.getRealTime((error, time) => { + if (error) { + console.info(`Failed to getting real time. message: ${error.message}, code: ${error.code}`); + return; + } + console.info(`Succeeded in getting real time : ${time}`); + }); } catch(e) { - console.info(`Failed to get real time. message:${e.message}, code:${e.code}`); + console.info(`Failed to get real time. message: ${e.message}, code: ${e.code}`); } ``` @@ -384,7 +464,7 @@ Obtains the time elapsed since system startup, including the deep sleep time. Th | Name| Type | Mandatory| Description | | ------ | ------- | ---- | ------------------------------- | -| isNano | boolean | No | Whether the time to return is in nanoseconds.
- **true**: in nanoseconds (ns).
- **false**: in milliseconds (ms).| +| isNano | boolean | No | Whether the time to return is in nanoseconds.
- **true**: in nanoseconds.
- **false**: in milliseconds.| **Return value** @@ -392,17 +472,25 @@ Obtains the time elapsed since system startup, including the deep sleep time. Th | --------------------- | ------------------------------- | | Promise<number> | Promise used to return the time elapsed since system startup, including the deep sleep time.| +**Error codes** + +For details about the error codes, see [Time and Time Zone Service Error Codes](../errorcodes/errorcode-time.md). + +| ID| Error Message | +| -------- | ------------------------------------------- | +| -1 | The parameter check failed or system error. | + **Example** ```js try { - systemTime.getRealTime().then((time) => { - console.info(`Succeeded in getting real time : ${time}`); - }).catch((error) => { - console.info(`Failed to getting real time. message:${error.message}, code:${error.code}`); - }); + systemTime.getRealTime().then((time) => { + console.info(`Succeeded in getting real time : ${time}`); + }).catch((error) => { + console.info(`Failed to getting real time. message: ${error.message}, code: ${error.code}`); + }); } catch(e) { - console.info(`Failed to get real time. message:${e.message}, code:${e.code}`); + console.info(`Failed to get real time. message: ${e.message}, code: ${e.code}`); } ``` @@ -423,20 +511,28 @@ Sets the system date. This API uses an asynchronous callback to return the resul | date | Date | Yes | Target date to set. | | callback | AsyncCallback<void> | Yes | Callback used to return the result.| +**Error codes** + +For details about the error codes, see [Time and Time Zone Service Error Codes](../errorcodes/errorcode-time.md). + +| ID| Error Message | +| -------- | ------------------------------------------------------------ | +| -1 | The parameter check failed or permission denied or system error. | + **Example** ```js let date = new Date(); try { - systemTime.setDate(date, (error) => { - if (error) { - console.info(`Failed to setting date. message:${error.message}, code:${error.code}`); - return; - } - console.info(`Succeeded in setting date.`); - }); + systemTime.setDate(date, (error) => { + if (error) { + console.info(`Failed to setting date. message: ${error.message}, code: ${error.code}`); + return; + } + console.info(`Succeeded in setting date.`); + }); } catch(e) { - console.info(`Failed to set date. message:${e.message}, code:${e.code}`); + console.info(`Failed to set date. message: ${e.message}, code: ${e.code}`); } ``` @@ -462,18 +558,26 @@ Sets the system date. This API uses a promise to return the result. | ------------------- | -------------------- | | Promise<void> | Promise that returns no value.| +**Error codes** + +For details about the error codes, see [Time and Time Zone Service Error Codes](../errorcodes/errorcode-time.md). + +| ID| Error Message | +| -------- | ------------------------------------------------------------ | +| -1 | The parameter check failed or permission denied or system error. | + **Example** ```js let date = new Date(); try { - systemTime.setDate(date).then(() => { - console.info(`Succeeded in setting date.`); - }).catch((error) => { - console.info(`Failed to setting date. message:${error.message}, code:${error.code}`); - }); + systemTime.setDate(date).then(() => { + console.info(`Succeeded in setting date.`); + }).catch((error) => { + console.info(`Failed to setting date. message: ${error.message}, code: ${error.code}`); + }); } catch(e) { - console.info(`Failed to set date. message:${e.message}, code:${e.code}`); + console.info(`Failed to set date. message: ${e.message}, code: ${e.code}`); } ``` @@ -495,19 +599,27 @@ Obtains the current system date. This API uses an asynchronous callback to retur | -------- | -------------- | ---- | --------------------- | | callback | AsyncCallback<Date> | Yes | Callback used to return the current system date.| +**Error codes** + +For details about the error codes, see [Time and Time Zone Service Error Codes](../errorcodes/errorcode-time.md). + +| ID| Error Message | +| -------- | ------------------------------------------- | +| -1 | The parameter check failed or system error. | + **Example** ```js try { - systemTime.getDate((error, date) => { - if (error) { - console.info(`Failed to get date. message:${error.message}, code:${error.code}`); - return; - } - console.info(`Succeeded in get date : ${date}`);; - }); + systemTime.getDate((error, date) => { + if (error) { + console.info(`Failed to get date. message: ${error.message}, code: ${error.code}`); + return; + } + console.info(`Succeeded in get date : ${date}`);; + }); } catch(e) { - console.info(`Failed to get date. message:${e.message}, code:${e.code}`); + console.info(`Failed to get date. message: ${e.message}, code: ${e.code}`); } ``` @@ -529,17 +641,25 @@ Obtains the current system date. This API uses a promise to return the result. | ------------------- | ----------------------------------------- | | Promise<Date> | Promise used to return the current system date.| +**Error codes** + +For details about the error codes, see [Time and Time Zone Service Error Codes](../errorcodes/errorcode-time.md). + +| ID| Error Message | +| -------- | ------------------------------------------- | +| -1 | The parameter check failed or system error. | + **Example** ```js try { - systemTime.getDate().then((date) => { - console.info(`Succeeded in getting date : ${date}`); - }).catch((error) => { - console.info(`Failed to getting date. message:${error.message}, code:${error.code}`); - }); + systemTime.getDate().then((date) => { + console.info(`Succeeded in getting date : ${date}`); + }).catch((error) => { + console.info(`Failed to getting date. message: ${error.message}, code: ${error.code}`); + }); } catch(e) { - console.info(`Failed to get date. message:${e.message}, code:${e.code}`); + console.info(`Failed to get date. message: ${e.message}, code: ${e.code}`); } ``` @@ -560,19 +680,27 @@ Sets the system time zone. This API uses an asynchronous callback to return the | timezone | string | Yes | System time zone to set. For details, see [Supported System Time Zones](#supported-system-time-zones). | | callback | AsyncCallback<void> | Yes | Callback used to return the result.| +**Error codes** + +For details about the error codes, see [Time and Time Zone Service Error Codes](../errorcodes/errorcode-time.md). + +| ID| Error Message | +| -------- | ------------------------------------------------------------ | +| -1 | The parameter check failed or permission denied or system error. | + **Example** ```js try { - systemTime.setTimezone('Asia/Shanghai', (error) => { - if (error) { - console.info(`Failed to setting timezone. message:${error.message}, code:${error.code}`); - return; - } - console.info(`Succeeded in setting timezone.`); - }); + systemTime.setTimezone('Asia/Shanghai', (error) => { + if (error) { + console.info(`Failed to setting timezone. message: ${error.message}, code: ${error.code}`); + return; + } + console.info(`Succeeded in setting timezone.`); + }); } catch(e) { - console.info(`Failed to set timezone. message:${e.message}, code:${e.code}`); + console.info(`Failed to set timezone. message: ${e.message}, code: ${e.code}`); } ``` @@ -598,17 +726,25 @@ Sets the system time zone. This API uses a promise to return the result. | ------------------- | -------------------- | | Promise<void> | Promise that returns no value.| +**Error codes** + +For details about the error codes, see [Time and Time Zone Service Error Codes](../errorcodes/errorcode-time.md). + +| ID| Error Message | +| -------- | ------------------------------------------------------------ | +| -1 | The parameter check failed or permission denied or system error. | + **Example** ```js try { - systemTime.setTimezone('Asia/Shanghai').then(() => { - console.info(`Succeeded in setting timezone.`); - }).catch((error) => { - console.info(`Failed to setting timezone. message:${error.message}, code:${error.code}`); - }); + systemTime.setTimezone('Asia/Shanghai').then(() => { + console.info(`Succeeded in setting timezone.`); + }).catch((error) => { + console.info(`Failed to setting timezone. message: ${error.message}, code: ${error.code}`); + }); } catch(e) { - console.info(`Failed to set timezone. message:${e.message}, code:${e.code}`); + console.info(`Failed to set timezone. message: ${e.message}, code: ${e.code}`); } ``` @@ -630,19 +766,27 @@ Obtains the system time zone. This API uses an asynchronous callback to return t | -------- | --------- | ---- | ------------------------ | | callback | AsyncCallback<string> | Yes | Callback used to return the system time zone. For details, see [Supported System Time Zones](#supported-system-time-zones).| +**Error codes** + +For details about the error codes, see [Time and Time Zone Service Error Codes](../errorcodes/errorcode-time.md). + +| ID| Error Message | +| -------- | ------------------------------------------- | +| -1 | The parameter check failed or system error. | + **Example** ```js try { - systemTime.getTimezone((error, data) => { - if (error) { - console.info(`Failed to get timezone. message:${error.message}, code:${error.code}`); - return; - } - console.info(`Succeeded in get timezone : ${data}`);; - }); + systemTime.getTimezone((error, data) => { + if (error) { + console.info(`Failed to get timezone. message: ${error.message}, code: ${error.code}`); + return; + } + console.info(`Succeeded in get timezone : ${data}`);; + }); } catch(e) { - console.info(`Failed to get timezone. message:${e.message}, code:${e.code}`); + console.info(`Failed to get timezone. message: ${e.message}, code: ${e.code}`); } ``` @@ -664,17 +808,25 @@ Obtains the system time zone. This API uses a promise to return the result. | --------------------- | ------------------------------------- | | Promise<string> | Promise used to return the system time zone. For details, see [Supported System Time Zones](#supported-system-time-zones).| +**Error codes** + +For details about the error codes, see [Time and Time Zone Service Error Codes](../errorcodes/errorcode-time.md). + +| ID| Error Message | +| -------- | ------------------------------------------- | +| -1 | The parameter check failed or system error. | + **Example** ```js try { - systemTime.getTimezone().then((data) => { - console.info(`Succeeded in getting timezone: ${data}`); - }).catch((error) => { - console.info(`Failed to getting timezone. message:${error.message}, code:${error.code}`); - }); + systemTime.getTimezone().then((data) => { + console.info(`Succeeded in getting timezone: ${data}`); + }).catch((error) => { + console.info(`Failed to getting timezone. message: ${error.message}, code: ${error.code}`); + }); } catch(e) { - console.info(`Failed to get timezone. message:${e.message}, code:${e.code}`); + console.info(`Failed to get timezone. message: ${e.message}, code: ${e.code}`); } ``` diff --git a/en/application-dev/reference/errorcodes/Readme-EN.md b/en/application-dev/reference/errorcodes/Readme-EN.md index 28669ef9f2..b702a26619 100644 --- a/en/application-dev/reference/errorcodes/Readme-EN.md +++ b/en/application-dev/reference/errorcodes/Readme-EN.md @@ -12,6 +12,7 @@ - [Event Error Codes](errorcode-CommonEventService.md) - [DistributedNotificationService Error Codes](errorcode-DistributedNotificationService.md) - UI Page + - [Animator Error Codes](errorcode-animator.md) - [promptAction Error Codes](errorcode-promptAction.md) - [Router Error Codes](errorcode-router.md) - Graphics @@ -73,6 +74,7 @@ - [Vibrator Error Codes](errorcode-vibrator.md) - [System Parameter Error Codes](errorcode-system-parameterV9.md) - [USB Error Codes](errorcode-usb.md) + - [Update Error Codes](errorcode-update.md) - Customization Management - [Enterprise Device Management Error Codes](errorcode-enterpriseDeviceManager.md) - Language Base Class Library diff --git a/en/application-dev/reference/errorcodes/errorcode-time.md b/en/application-dev/reference/errorcodes/errorcode-time.md new file mode 100644 index 0000000000..d63b3914ad --- /dev/null +++ b/en/application-dev/reference/errorcodes/errorcode-time.md @@ -0,0 +1,25 @@ +# Time and Time Zone Service Error Codes + +## -1 Screen Unlock Error + +**Error Message** + +The parameter check failed or permission denied or system error. + +**Description** + +This error code is reported when a parameter check failure, permission verification failure, or system operation error occurs. + +**Possible Cause** + + +1. The input parameter is invalid. +2. The required permission is not configured. For example, **ohos.permission.SET_TIME** is not configured for setting the time or **ohos.permission.SET_TIME_ZONE** is not configured for setting the time zone. +3. The system is not running properly due to a common kernel error, such as a memory allocation and multi-thread processing error. + +**Solution** + +1. Make sure input parameters are passed in as required. +2. Configure the **ohos.permission.SET_TIME** permission for setting the time and the **ohos.permission.SET_TIME_ZONE** permission for setting the time zone. +3. Make sure the memory is sufficient. + -- GitLab