IntlDateFormatter
Implement the IntlDateFormatter::format()
for our date and time formatting as well let the IntlDateFormatter determine the DST according the chosen timezone.
1. Timezone
Upgrade: Set timezone for all users back to UTC
, the user must set his timezone again. The current offset is not unique and the DST depends on the location.
Registration: The Browser's Timezone can be detected via JavaScript, however this is also guesswork. Should we set here UTC
as default too?.
2. Upgrade
This changes a few things:
2.1. New format syntax
The installer resets your custom settings to the defaults. Change it again via the Admin panel with the new syntax.
config | DateTime::format | IntlDateFormatter |
---|---|---|
date_format | d.m.Y | dd.MM.yyyy |
time_format | H:i | HH:mm |
time_format_seconds | H:i:s | HH:mm:ss |
For example you might want set the date_format
to dd/MM/yyyy
.
ICU Formats
Date Field Symbol Table
date_format($unix_time, $pattern)
- the unix time must be passed as UTC time
2.1.1. Local formats
# | IntlDateFormatter | Example | Note |
---|---|---|---|
1 | dd.MM.yyyy | 10.07.1996 | de, et, pl, ru |
2 | dd/MM/yyyy | 10/07/1996 | es, fr |
3 | dd-MM-yyyy | 10-07-1996 | en_gb, hi, en_in, nl |
4 | yyyy-MM-dd | 1996-07-10 | ISO 8601 |
5 | yyyy/MM/dd | 1996-07-10 | fa |
6 | yyyy年MM月dd日 | 1996年07月10日 | ja, zh |
7 | yyyy년 MM월 dd일 | 1996년 07월 10일 | ko |
8 | MM/dd/yyyy | 07/10/1996 | en_us |
... |
2.2. Timezone
The installer sets the timezone for the system as well as for all users back to UTC
as default. Because the timezone DST is determined by the location the users have to set their location in the user settings again, the timezone offset is only an indicator and not unique.
If all of your users work in one place, you can set the timezone via a SQL query:
UPDATE wacko_user_setting SET timezone = 'Pacific/Tahiti' WHERE timezone = 'UTC';
2.3. Installation
Do not forget to delete per hand the config cache and restart your browser before you run the upgrade process, so you get a new session - else it will use your old session after the upgrade and you will get a 500er error, because the 'timezone' must be set 'UTC' in the session.
This change will be available with WackoWiki 6.1.4 release.