March 2003
Intermediate to advanced
656 pages
39h 30m
English
strftime, Format
d.strftime(fmt="%c”)
Returns a string representing
d as specified by string
fmt. The syntax of
fmt is the same as in
time.strftime, covered in Section 12.1 earlier in this chapter, but
not all specifiers are meaningful. The result of
d
.strftime does not
reflect the sign of the time interval that
d represents; to display the sign as well,
you must affix it to the string by separate string manipulation. For
example:
ifd.seconds >= 0.0: returnd.strftime(fmt) else: return '-' +d.strftime(fmt)
Format is a synonym of strftime.