#NEWLINE# @ classmethod #NEWLINE# def _StringToDatetime( cls , strTimestamp ) : #NEWLINE# #INDENT# if ( type ( strTimestamp ) is not str ) : #NEWLINE# #INDENT# strTimestamp = strTimestamp . decode ( 'utf-8' ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# dts = datetime . strptime ( strTimestamp , SidFile . _timestamp_format ) #NEWLINE# #UNINDENT# except ValueError : #NEWLINE# #INDENT# if ( SidFile . _timestamp_format == SidFile . _TIMESTAMP_STANDARD ) : #NEWLINE# #INDENT# dts = datetime . strptime ( strTimestamp , SidFile . _TIMESTAMP_EXTENDED ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# dts = datetime . strptime ( strTimestamp , SidFile . _TIMESTAMP_STANDARD ) #NEWLINE# #UNINDENT# #UNINDENT# return dts