@LocaleTime()
New in 2.0Generate localized current time
Date and TimeSince 2.0.0
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| format | String | — | HH:mm:ss | Time format pattern, default "HH:mm:ss" |
| zoneId | String | — | Asia/Shanghai | Timezone ID, default "Asia/Shanghai" |
| random | Boolean | — | false | Generate random time within day, default false |
Usage
@LocaleTime()Generate current time (HH:mm:ss, Asia/Shanghai)
Example:
@LocaleTime()
Output:
23:32:1323:32:13@LocaleTime(format)Generate current time with specified format
Example:
@LocaleTime(a HH:mm:ss)
Output:
下午 23:34:25下午 23:34:25@LocaleTime(format,random)Generate random time with specified format
Example:
@LocaleTime(a HH:mm:ss)
Output:
下午 23:34:25下午 23:34:25@LocaleTime(format,zoneId,random)Generate random time with specified format and timezone
Example:
@LocaleDate(HH:mm:ss,Asia/Tokyo)
Output:
07:08:2107:08:21