[issue6316] format, str.format don't work well with datetime, date object

2009-06-20 Thread Jeong-Min Lee
Jeong-Min Lee added the comment: I got it. By the way, It would be good to document that this behaviour (at least about datetime.__format__) -- ___ Python tracker ___ ___

[issue6316] format, str.format don't work well with datetime, date object

2009-06-20 Thread Eric Smith
Eric Smith added the comment: This is by design. Where d is a datetime, format(d, format_string) returns d.strftime(format_string). >>> d.strftime('30') '30' -- resolution: -> invalid status: open -> closed ___ Python tracker

[issue6316] format, str.format don't work well with datetime, date object

2009-06-20 Thread Eric Smith
Changes by Eric Smith : -- assignee: -> eric.smith components: +Interpreter Core -Extension Modules, Library (Lib) nosy: +eric.smith ___ Python tracker ___ __

[issue6316] format, str.format don't work well with datetime, date object

2009-06-20 Thread Jeong-Min Lee
New submission from Jeong-Min Lee : format(datetime_obj, format_string) return format_string. (when format_string is not empty.) >>> import datetime >>> d = datetime.datetime.now() >>> format(d) '2009-06-20 23:51:54.243428' >>> format(d, '') '2009-06-20 23:51:54.243428' >>> d datetime.datetime(