You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Special CJK date formatting options.
* Added Timezone.getAllTransitions() function. Improved retrieval of timezone updates, taking advantage of tzexplorer.org.
`ttime().toLocale('de').format('ddd MMM D, y N [at] h:mm A z')` →<br>
188
189
`Mi 02 3, 2021 n. Chr. at 9:43 PM GMT-5`
189
190
190
-
Please note that, as most unaccented Latin letters are interpreted as special formatting characters, when using those characters as literal text they should be surrounded with square brackets, as with the word “at” above.
191
+
Please note that most unaccented Latin letters (a-z, A-Z) are interpreted as special formatting characters, as well as the tilde (`~`), so when using those characters as literal text they should be surrounded with square brackets, as with the word “at” in the example above.
192
+
193
+
### Special CJK date formatting options
194
+
195
+
A few of the formatting tokens below can have an optional trailing tilde (`~`) added. This is for special handling of Chinese, Japanese, and Korean (CJK) date notation. The `~` is replaced, where appropriate, with `年`, `月`, or `日` for Chinese and Japanese, and with `년`, `월`, or `일` for Korean. Korean formatting also adds a space character when the following character is a letter or digit, but not when punctuation or the end of the format string comes next.
196
+
197
+
For all other languages, `~` is replaced with a space character when the following character is a letter or digit, or simply removed when followed by punctuation or the end of the format string.
191
198
192
199
## Format string tokens
193
200
@@ -197,27 +204,27 @@ Please note that, as most unaccented Latin letters are interpreted as special fo
197
204
| | NNNN | Before Christ, Anno Domini<br><br>Long-form era.
198
205
|| n | BC<br><br>Abbreviated era, only shows for BC, not AD. When year is AD, leading space before `n` token is removed. |
199
206
| Year | YYYYYY | -001970 -001971 ... +001907 +001971<br><br>Always-signed years, padded to six digits. |
200
-
|| YYYY | 1970 1971 ... 2029 2030<br><br>Padded to at least four digits. |
207
+
|| YYYY <br>YYYY~| 1970 1971 ... 2029 2030<br><br>Padded to at least four digits. With `~`, `年` or `년` is added when needed for CJK locales, otherwise replaced by a space character or empty string. |
201
208
|| YY | 70 71 ... 29 30<br><br>Padded to two digits with leading zero if necessary. |
202
209
|| Y | 1970 1971 ... 9999 +10000 +10001<br><br>Padded to at least four digits, `+` sign shown when over 9999. |
203
-
|| y | 1 2 ... 2020 ...<br>Era year, for use with BC/AD, never 0 or negative. |
210
+
|| y <br>y~| 1 2 ... 2020 ...<br><br>Era year, for use with BC/AD, never 0 or negative. With `~`, `年` or `년` is added when needed for CJK locales, otherwise `~` is replaced by a space character or empty string. |
204
211
| Week year (ISO) | GGGG | 1970 1971 ... 2029 2030, `+` sign shown when over 9999. |
205
212
|| GG | 70 71 ... 29 30<br><br>Padded to two digits with leading zero if necessary. |
206
213
| Week year (locale) | gggg | 1970 1971 ... 2029 2030, `+` sign shown when over 9999. |
207
214
|| gg | 70 71 ... 29 30<br><br>Padded to two digits with leading zero if necessary. |
208
215
| Quarter | Qo | 1st 2nd 3rd 4th |
209
216
|| Q | 1 2 3 4 |
210
-
| Month | MMMM | January February ... November December |
217
+
| Month | MMMM <br>MMMM~| January February ... November December<br>1月 2月 ... 11月 12月 • 一月 二月 ... 十一月 十二月 • 1월 2월 ... 11월 12월<br><br>For CJK locales, `月` or `월` is added when using either the `MMMM` and `MMMM~` token, but using `MMMM~` allows the position of the `~` to be replaced with a blank, when appropriate, for other languages.|
211
218
|| MMM | Jan Feb ... Nov Dec |
212
-
|| MM | 01 02 ... 11 12 |
213
-
|| M | 1 2 ... 11 12 |
219
+
|| MM <br>MM~| 01 02 ... 11 12<br><br>With `~`, `月` or `월` is added when needed for CJK locales, otherwise `~` is replaced by a space character or empty string.|
220
+
|| M <br>M~| 1 2 ... 11 12<br><br>With `~`, `月` or `월` is added when needed for CJK locales, otherwise `~` is replaced by a space character or empty string.|
214
221
|| Mo | 1st 2nd ... 11th 12th |
215
222
| Week (ISO) | WW | 01 02 ... 52 53 |
216
223
|| W | 1 2 ... 52 53 |
217
224
| Week (locale) | ww | 01 02 ... 52 53 |
218
225
|| w | 1 2 ... 52 53 |
219
-
| Day of month | DD | 01 02 ... 30 31 |
220
-
|| D | 1 2 ... 30 31 |
226
+
| Day of month | DD <br>DD~| 01 02 ... 30 31<br><br>With `~`, `日` or `일` is added when needed for CJK locales, otherwise `~` is replaced by a space character or empty string.|
227
+
|| D <br>D~| 1 2 ... 30 31<br><br>With `~`, `日` or `일` is added when needed for CJK locales, otherwise `~` is replaced by a space character or empty string.|
*`ywl`/ `yearByWeekLocale`, etc: These fields work the same as `yw` /`yearByWeek`, etc., exceptthattheyapplytolocale-specificrulesforthedayoftheweekonwhicheachweekstarts, andforthedefinitionofthefirstweekoftheyear.
534
+
*`ywl`/ `yearByWeekLocale`, etc.: These fields work the same as `yw` /`yearByWeek`, etc., exceptthattheyapplytolocale-specificrulesforthedayoftheweekonwhicheachweekstarts, andforthedefinitionofthefirstweekoftheyear.
@@ -926,9 +933,9 @@ UTC (Universal Coordinated Time) is not a uniform timescale. It is currently def
926
933
927
934
ThecurrentsystemforUTCwasadoptedin1970andimplementedin1972[*](https://en.wikipedia.org/wiki/Coordinated_Universal_Time). UTC is only strictly defined relative to TAI starting in 1972 and going forward in time until the next announced omission or addition of a leap second. You can, however, create a **@tubular/time** `DateTime` instance using UTC while also using year values in the distant past or future.
Duringaleapsecondthe`epochMillis`/`utcMillis`valueispinned59seconds, 999millisecondsintotheminuteinwhichtheleapsecondsoccurs. The`taiMillis`value, however, stillvariesoverthecourseofthatsecond.
0 commit comments