Next / Previous / Contents / Shipman's homepage

6.8. parseTime(): Parse external time

This function converts a time of day, with optional time zone suffix. For the syntax, see Section 4.1, “Specifying dates and times on command lines”; the time is everything after the “T” separator.

parseTime(s)

The argument s is a string whose format must match the specified format. If successful, the function returns the time as a datetime.time instance. If the format is incorrect, the function raises a SyntaxError exception.