Returns a string representation of the given time value. If
Seconds
is
False
, the format is "HH:MM",
seconds are omitted. If
Seconds
is
True
,
the format is "HH:MM:SS".
If AM_PM
is false, the international 24h representation
is chosen, otherwise the english a.m./p.m. format is generated: the
hour part always is in the range 0 .. 11, and the strings " am" or
" pm" are appended as needed. Note that noon and midnight cannot be
represented in the am/pm system (12:00 am or 00:00 am have no meaning
at all; "am" starts after midnight, and "pm" starts
after noon). If AM_PM
is True
, noon
generates the string "Noon", and midnight generates the
string "Midnight". Note that midnight is 00:00:00, hence it is the
beginning of the day, not the end! Also note that you still can get a
string "00:00 am" or "00:00:00 am" if the seconds or the fraction is >
zero, but not displayed.
The function never rounds, i.e. seconds or fractions omitted are just
truncated, e.g. 11:11:59.665 yields "11:11" or "11:11:59".