[issue10938] Undocumented option for datetime.strftime: %s

2011-01-18 Thread Humberto Diogenes

New submission from Humberto Diogenes humbe...@digi.com.br:

On some systems, datetime.strftime() accepts a %s format string that returns 
epoch / UNIX timestamp, but this behavior is not documented at 
http://docs.python.org/library/datetime.html

Python 2.7 (r27:82508, Jul  3 2010, 21:12:11) 
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin
Type help, copyright, credits or license for more information.
 import datetime
 datetime.datetime.now().strftime('%s')
'1295376929'

--
assignee: docs@python
components: Documentation
messages: 126481
nosy: docs@python, hdiogenes
priority: normal
severity: normal
status: open
title: Undocumented option for datetime.strftime: %s
versions: Python 2.7

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10938
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10938] Undocumented option for datetime.strftime: %s

2011-01-18 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

As you say, on some systems.  The variation is documented, and the documented 
codes are documented as being just those required by the C standard.

--
nosy: +r.david.murray
resolution:  - invalid
stage:  - committed/rejected
status: open - closed
type:  - behavior

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10938
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10938] Undocumented option for datetime.strftime: %s

2011-01-18 Thread Humberto Diogenes

Humberto Diogenes humbe...@digi.com.br added the comment:

David, as discussed on the IRC channel: maybe we could just add pointers to the 
OS-specific docs. Something like:


If you want to use platform-specific format strings, search for strftime in 
your OS documentation (`man strftime` on POSIX systems).

Linux: http://www.kernel.org/doc/man-pages/online/pages/man3/strftime.3.html

Mac OS: 
http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man3/strftime.3.html


--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10938
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com