akira added the comment: > ``%s`` format code behaviour was undefined and incidental.
strftime('%s') is not portable but it *is* supported on some platforms i.e., it is *not* undefined and it is *not* incidental on these platforms. datetime.strftime *delegates* to the platform strftime(3) and some platforms do support %s format code. See the quote from the datetime docs in msg221385. It would be preferable that datetime.strftime would reject format codes that it doesn't support explicitly (like datetime.strptime does) so that datetime.strftime were portable but that ship has sailed. This issue could be titled: add cross-platform support for %s strftime-format code (and fix its behavior (add support) for timezone-aware datetime objects). --- If the implementation uses floats to get an integer result; it should have tests for edge cases (datetime.min, datetime.max at least). I don't see such tests, please, correct me if I'm wrong. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue12750> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com