I'm working on a project which uses l10n.
If I set the locale to EN and try to display a time (08:00), I get:
8 a.m.
If I set the locale to FR I get:
08:00:00
But it should be something like:
8h
Why am I getting this format ? How can I get the proper format ?
Apparently there is no default time format set for FR locale.
What you can do is configure the format module:
# myproject/settings.py
FORMAT_MODULE_PATH = 'myproject.formats'
Create it:
myproject/
formats/
__init__.py
fr/
__init__.py
formats.py
And define the french format:
# myproject/formats/fr/formats.py
TIME_FORMAT = 'G:i'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With