@LocaleDate()
New in 2.0Generate localized current date
Date and TimeSince 2.0.0
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| format | — | — | Date format pattern, default "yyyy-MM-dd" | |
| zoneId | — | — | Timezone ID, default "Asia/Shanghai" | |
| random | — | — | Generate random dates ±10 years, default false |
Usage
@LocaleDate(arg0,arg1,arg2)Generate random date with specified format and timezone
Example:
@LocaleDate(yyyy-MM-dd,Asia/Shanghai)
Output:
2022-01-012022-01-01@LocaleDate(arg0,arg1)Generate random date with specified format
Example:
@LocaleDate(yyyy yy y MM M dd d)
Output:
2022 22 2022 05 5 12 122022 22 2022 05 5 12 12@LocaleDate(arg0)Generate current date with specified format
Example:
@LocaleDate(yyyy yy y MM M dd d)
Output:
2022 22 2022 05 5 12 122022 22 2022 05 5 12 12@LocaleDate()Generate current date (yyyy-MM-dd, Asia/Shanghai)
Example:
@LocaleDate()
Output:
2022-01-012022-01-01