Lines Matching refs:time
3 …module provides system time and time zone features. You can use the APIs of this module to set and…
17 Enumerates the types of time to obtain.
23 …TUP | 0 | Number of milliseconds elapsed since system startup, including the deep sleep time. |
24 …TIVE | 1 | Number of milliseconds elapsed since system startup, excluding the deep sleep time.|
30 Obtains the time elapsed since the Unix epoch. This API uses an asynchronous callback to return the…
42 | isNano | boolean | Yes | Whether the time to return is in nanoseconds.<br>…
43 | callback | AsyncCallback<number> | Yes | Callback used to return the time elapsed since th…
47 For details about the error codes, see [Time and Time Zone Service Error Codes](./errorcode-time.md…
59 systemDateTime.getCurrentTime(true, (error: BusinessError, time: number) => {
64 console.info(`Succeeded in getting currentTime : ${time}`);
76 Obtains the time elapsed since the Unix epoch. This API uses an asynchronous callback to return the…
88 | callback | AsyncCallback<number> | Yes | Callback used to return the time elapsed since th…
92 For details about the error codes, see [Time and Time Zone Service Error Codes](./errorcode-time.md…
104 systemDateTime.getCurrentTime((error: BusinessError, time: number) => {
109 console.info(`Succeeded in getting currentTime : ${time}`);
121 Obtains the time elapsed since the Unix epoch. This API uses a promise to return the result.
133 | isNano | boolean | No | Whether the time to return is in nanoseconds. The default value is **fal…
143 For details about the error codes, see [Time and Time Zone Service Error Codes](./errorcode-time.md…
155 systemDateTime.getCurrentTime().then((time: number) => {
156 console.info(`Succeeded in getting currentTime : ${time}`);
170 Obtains the time elapsed since system startup, excluding the deep sleep time. This API uses an asyn…
182 | isNano | boolean | Yes | Whether the time to return is in nanoseconds.<br>…
183 | callback | AsyncCallback<number> | Yes | Callback used to return the time.|
187 For details about the error codes, see [Time and Time Zone Service Error Codes](./errorcode-time.md…
199 systemDateTime.getRealActiveTime(true, (error: BusinessError, time: number) => {
201 … console.info(`Failed to get real active time. message: ${error.message}, code: ${error.code}`);
204 console.info(`Succeeded in getting real active time : ${time}`);
208 console.info(`Failed to get real active time. message: ${error.message}, code: ${error.code}`);
216 Obtains the time elapsed since system startup, excluding the deep sleep time. This API uses an asyn…
228 | callback | AsyncCallback<number> | Yes | Callback used to return the time.|
232 For details about the error codes, see [Time and Time Zone Service Error Codes](./errorcode-time.md…
244 systemDateTime.getRealActiveTime((error: BusinessError, time: number) => {
246 … console.info(`Failed to get real active time. message: ${error.message}, code: ${error.code}`);
249 console.info(`Succeeded in getting real active time : ${time}`);
253 console.info(`Failed to get real active time. message: ${error.message}, code: ${error.code}`);
261 Obtains the time elapsed since system startup, excluding the deep sleep time. This API uses a promi…
273 | isNano | boolean | No | Whether the time to return is in nanoseconds. The default value is **fal…
279 …<number> | Promise used to return the time elapsed since system startup, excluding the deep …
283 For details about the error codes, see [Time and Time Zone Service Error Codes](./errorcode-time.md…
295 systemDateTime.getRealActiveTime().then((time: number) => {
296 console.info(`Succeeded in getting real active time : ${time}`);
298 console.info(`Failed to get real active time. message: ${error.message}, code: ${error.code}`);
302 console.info(`Failed to get real active time. message: ${error.message}, code: ${error.code}`);
310 Obtains the time elapsed since system startup, including the deep sleep time. This API uses an asyn…
322 | isNano | boolean | Yes | Whether the time to return is in nanoseconds.<br>…
323 | callback | AsyncCallback<number> | Yes | Callback used to return the time. |
327 For details about the error codes, see [Time and Time Zone Service Error Codes](./errorcode-time.md…
339 systemDateTime.getRealTime(true, (error: BusinessError, time: number) => {
341 console.info(`Failed to get real time. message: ${error.message}, code: ${error.code}`);
344 console.info(`Succeeded in getting real time : ${time}`);
348 console.info(`Failed to get real time. message: ${error.message}, code: ${error.code}`);
356 Obtains the time elapsed since system startup, including the deep sleep time. This API uses an asyn…
368 | callback | AsyncCallback<number> | Yes | Callback used to return the time. |
372 For details about the error codes, see [Time and Time Zone Service Error Codes](./errorcode-time.md…
384 systemDateTime.getRealTime((error: BusinessError, time: number) => {
386 console.info(`Failed to get real time. message: ${error.message}, code: ${error.code}`);
389 console.info(`Succeeded in getting real time : ${time}`);
393 console.info(`Failed to get real time. message: ${error.message}, code: ${error.code}`);
401 Obtains the time elapsed since system startup, including the deep sleep time. This API uses a promi…
413 | isNano | boolean | No | Whether the time to return is in nanoseconds. The default value is **fal…
419 …<number> | Promise used to return the time elapsed since system startup, including the deep …
423 For details about the error codes, see [Time and Time Zone Service Error Codes](./errorcode-time.md…
435 systemDateTime.getRealTime().then((time: number) => {
436 console.info(`Succeeded in getting real time : ${time}`);
438 console.info(`Failed to get real time. message: ${error.message}, code: ${error.code}`);
442 console.info(`Failed to get real time. message: ${error.message}, code: ${error.code}`);
450 Obtains the time elapsed since the Unix epoch. This API returns the result synchronously.
458 | isNanoseconds | boolean | No | Whether the time to return is in nanoseconds.<br>- **true**: in n…
472 let time = systemDateTime.getTime(true)
475 console.info(`Failed to get time. message: ${error.message}, code: ${error.code}`);
483 Obtains the time elapsed since system startup. This API returns the result synchronously.
491 | timeType | [TimeType](#timetype10) | Yes | Type of the time to be obtained. The value can o…
492 | isNanoseconds | boolean | No | Whether the time to return is in nanoseconds.<br>…
502 For details about the error codes, see [Time and Time Zone Service Error Codes](errorcode-time.md).
514 let time = systemDateTime.getUptime(systemDateTime.TimeType.ACTIVE, false);
541 For details about the error codes, see [Time and Time Zone Service Error Codes](./errorcode-time.md…
586 For details about the error codes, see [Time and Time Zone Service Error Codes](./errorcode-time.md…
613 Obtains the system time zone. This API uses an asynchronous callback to return the result.
621 … Callback used to return the system time zone. For details, see [Supported System Time Zones](#sup…
646 Obtains the system time zone. This API uses a promise to return the result.
654 …| Promise used to return the system time zone. For details, see [Supported System Time Zones](#sup…
677 Obtains the system time zone in synchronous mode.
685 | string | System time zone. For details, see [Supported System Time Zones](#supported-system-time-…
702 …ing table lists the supported system time zones and the respective offset (unit: h) between each t…