def guess_datetime(datetime_string):
if CFG_HAS_EGENIX_DATETIME:<EOL><INDENT>try:<EOL><INDENT>return Parser.DateTimeFromString(datetime_string).timetuple()<EOL><DEDENT>except ValueError:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>else:<EOL><INDENT>for format in (None, '<STR_LIT>', '<STR_LIT>', '<STR_LIT>'):<EOL><INDENT>try:<EOL><INDENT>return time.strptime(datetime_string, format)<EOL><DEDENT>except ValueError:<EOL><INDENT>pass<EOL><DEDENT><DEDENT><DEDENT>raise ValueError("<STR_LIT>" %<EOL>datetime_string)<EOL>
Try to guess the datetime contained in a string of unknow format.

    @param datetime_string: the datetime representation.
    @type datetime_string: string
    @return: the guessed time.
    @rtype: L{time.struct_time}
    @raises ValueError: in case it's not possible to guess the time.