| timeZoneOffset | number | No | Time zone offset| Sets the time zone offset. The value range is [-14, 12], indicating UTC+12 to UTC-12. A negative value indicates Eastern Standard Time, and a positive value indicates Western Standard Time. For example, **-8** indicates UTC+8. For countries or regions crossing the International Date Line, use -13 (UTC+13) and -14 (UTC+14) to ensure consistent time within the entire country or region. |
| timeZoneOffset | number | No | Time zone offset of the current system| Time zone offset.<br>The value range is [-14, 12], indicating UTC+12 to UTC-12. A negative value indicates Eastern Standard Time, and a positive value indicates Western Standard Time. For example, **-8** indicates UTC+8.<br>For countries or regions crossing the International Date Line, use -13 (UTC+13) and -14 (UTC+14) to ensure consistent time within the entire country or region. If the set value is not within the valid range, the time zone offset of the current system will be used.|
| contorller | [TextClockContorller](#textclockcontroller) | No| null | Binds a controller to control the status of the **<TextClock\>** component. |
| contorller | [TextClockContorller](#textclockcontroller) | No| null | Binds a controller to control the status of the **<TextClock\>** component.|
## Attributes
## Attributes
...
@@ -30,25 +31,24 @@ In addition to the [universal attributes](ts-universal-attributes-size.md), the
...
@@ -30,25 +31,24 @@ In addition to the [universal attributes](ts-universal-attributes-size.md), the
| format | string | 'hhmmss' | Time format, for example, **yyyy/mm/dd** or **yyyy-mm-dd**. Supported time format strings: <ul><li>yyyy (year)</li><li>mm (two-letter abbreviated month name)</li><li>mmm (three-letter abbreviated month name)</li><li>mmmm (full month name)</li><li>dd (two-letter abbreviated day of the week)</li><li>ddd (three-letter abbreviated day of the week)</li><li>dddd (full day of the week)</li><li>HH (24-hour format)</li><li>hh (12-hour format)</li><li>MM/mm (minute)</li><li>SS/ss (second)</li></ul>|
| format | string | 'hms' | Time format.<br>The date separator is a slash (/), and the time separator is a colon (:).<br>For example, yyyyMMdd and yyyy-MM-dd are displayed as yyyy/MM/dd,<br>and hhmmss is displayed as hh:mm:ss.<br>Only one digit is required for the time format. This means that hhmmss is equivalent to hms.<br>Supported time format strings:<br>- YYYY/yyyy: four-digit year<br>- YY/yy: last two digits of year<br>- M: one-digit month (MM for two-digit month, for example, 01)<br>- d: one-digit day (dd for two-digit day, for example, 01)<br>- D: number of days that have elapsed in the year<br>- H: 24-hour format<br>- h: 12-hour format<br>- m: minute<br>- s: second<br>- SSS: millisecond|
## Events
## Events
In addition to the [universal events](ts-universal-events-click.md), the following attributes are supported.
In addition to the universal events (ts-universal-events-click.md), the following events are supported.
| onDateChange(event: (value: number) => void) | Triggered when the time changes in seconds at minimum.<br>**value**: Unix time stamp, which is the number of milliseconds that have elapsed since the Unix epoch. |
| onDateChange(event: (value: number) => void) | Called when the time changes in seconds at minimum.<br>**value**: Unix time stamp, which is the number of milliseconds that have elapsed since the Unix epoch. |
## TextClockController
## TextClockController
Controller of the **<TextClock\>** component, which can be bound to the component for status control.
Implements a controller of the **<TextClock\>** component, which can be bound to the component for status control.