
I wonder why https://docs.python.org/3.8/library/time.html#time.strftime is missing the directives %G, %u and %V for the ISO week date, although they work: $ python3 Python 3.8.10 (default, Sep 28 2021, 16:10:42) [GCC 9.3.0] on linux Type "help", "copyright", "credits" or "license" for more information.
Were these directives forgotten in the documentation or why were they not documented? Best regards, Rafał

Hi,
I wonder why https://docs.python.org/3.8/library/time.html#time.strftime is missing the directives %G, %u and %V for the ISO week date, although they work
That's because it can use the underlying libc strftime (https://manpages.debian.org/bullseye/manpages-dev/strftime.3.en.html) which may or may not implement them because they're not part of C89, like many others. So using them may yield Python code that would not work everywhere. Maybe we can bet most platforms have them now and they could be documented, maybe with a little warning, if you think so please open an issue on bugs.python.org so it can be discussed, or comment in https://bugs.python.org/issue44787 if you feel it's relevant. Bests, -- Julien Palard https://mdk.fr

Hi Julien, Thanks for the quick reply. I understand that first and foremost the directives that work everywhere are documented. Yes, I think they should/could also be documented in the time library with a little warning, as was done in the datetime library: https://docs.python.org/3/library/datetime.html#strftime-and-strptime-format... I will also submit this on https://bugs.python.org. Best regards, Rafał

Hi,
I wonder why https://docs.python.org/3.8/library/time.html#time.strftime is missing the directives %G, %u and %V for the ISO week date, although they work
That's because it can use the underlying libc strftime (https://manpages.debian.org/bullseye/manpages-dev/strftime.3.en.html) which may or may not implement them because they're not part of C89, like many others. So using them may yield Python code that would not work everywhere. Maybe we can bet most platforms have them now and they could be documented, maybe with a little warning, if you think so please open an issue on bugs.python.org so it can be discussed, or comment in https://bugs.python.org/issue44787 if you feel it's relevant. Bests, -- Julien Palard https://mdk.fr

Hi Julien, Thanks for the quick reply. I understand that first and foremost the directives that work everywhere are documented. Yes, I think they should/could also be documented in the time library with a little warning, as was done in the datetime library: https://docs.python.org/3/library/datetime.html#strftime-and-strptime-format... I will also submit this on https://bugs.python.org. Best regards, Rafał
participants (2)
-
Julien Palard
-
rafal1.1990@o2.pl