Mümin Öztürk added the comment: I made a patch for datetime.strftime('%s'). it takes tzinfo into consideration.
>>> datetime.datetime(1970,1,1).strftime("%s") '-7200' >>> datetime.datetime(1970,1,1, tzinfo=datetime.timezone.utc).strftime("%s") '0' datetime.date still behave as naive datetime.datetime >>> datetime.date(1970,1,1).strftime("%s") '-7200' ---------- keywords: +patch nosy: +mumino Added file: http://bugs.python.org/file27231/strftime.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue12750> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com