# Default date format when language not set for a user

**URL:** https://discuss.tryton.org/t/default-date-format-when-language-not-set-for-a-user/4522
**Category:** Developer
**Created:** [August 6, 2021, 3:05pm UTC](https://discuss.tryton.org/t/default-date-format-when-language-not-set-for-a-user/4522 "2021-08-06T15:05:07Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![pocock](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/p/a88e57/32.png) [@pocock](https://discuss.tryton.org/u/pocock)
#### Post date: [August 6, 2021, 3:05pm UTC](https://discuss.tryton.org/t/default-date-format-when-language-not-set-for-a-user/4522/1 "2021-08-06T15:05:07Z")

</div>

This is tangential to the thread about [date format issues](https://discuss.tryton.org/t/date-format-is-wrong/4172)

I open this as a separate topic to focus on one specific but important choice: the date format used if the user did not set their language in the user preferences.

The current default, suggested in the other thread, is to use the system date format. In some cases, that doesn’t seem to happen correctly.

An alternative proposal would be using the ISO 8601 format: `%Y-%m-%d`

The benefit of this proposal is that it is really obvious that there is no default.

Currently, if people enter values where `%d` is less than or equal to 12, the day and month are swapped and the user may not realize something bad happened.

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [August 7, 2021, 10:42am UTC](https://discuss.tryton.org/t/default-date-format-when-language-not-set-for-a-user/4522/2 "2021-08-07T10:42:03Z")

</div>

On desktop it is `%x` which uses locales of the system (in the interface language).  
On web it is `%Y-%m-%d` due to lack of similar feature.

---

<div class="post-metadata">

### Author: ![pocock](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/p/a88e57/32.png) [@pocock](https://discuss.tryton.org/u/pocock)
#### Post date: [August 9, 2021, 7:04pm UTC](https://discuss.tryton.org/t/default-date-format-when-language-not-set-for-a-user/4522/3 "2021-08-09T19:04:19Z")

</div>

There are two problems with `%x`:

- it appears to be unreliable (see the last comment in the other thread)
- in cases where it is incorrect, it may not be obvious that `%d` and `%m` have been swapped

Would you consider abandoning `%x` and using the same ISO 8601 format for both web and desktop?

This question is independent of the other issue: why my Python gives the wrong value for `%x`

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [August 9, 2021, 10:03pm UTC](https://discuss.tryton.org/t/default-date-format-when-language-not-set-for-a-user/4522/4 "2021-08-09T22:03:13Z")

</div>

> [@pocock](#):
>
> it appears to be unreliable (see the last comment in the other thread)

It is not unreliable.

> [@pocock](#):
>
> in cases where it is incorrect, it may not be obvious that `%d` and `%m` have been swapped

If user does not know the format, there is any format that could fix that.

> [@pocock](#):
>
> Would you consider abandoning `%x` and using the same ISO 8601 format for both web and desktop?

No because it provides a bad experience for the user.

---

<div class="post-metadata">

### Author: ![pocock](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/p/a88e57/32.png) [@pocock](https://discuss.tryton.org/u/pocock)
#### Post date: [August 10, 2021, 7:39pm UTC](https://discuss.tryton.org/t/default-date-format-when-language-not-set-for-a-user/4522/5 "2021-08-10T19:39:23Z")

</div>

> [@ced](#):
>
> No because it provides a bad experience for the user.

Why?

The swapped `%d` and `%m` are really bad for a user.

The ISO 8601 format may be unfamiliar for some users but it is the lesser evil

---

<div class="post-metadata">

### Author: ![nicoe](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/nicoe/32/2880_2.png) [@nicoe](https://discuss.tryton.org/u/nicoe)
#### Post date: [August 11, 2021, 7:13am UTC](https://discuss.tryton.org/t/default-date-format-when-language-not-set-for-a-user/4522/6 "2021-08-11T07:13:50Z")

</div>

This discussion is moot as `%x` should do the work anyway.
