def dt_str_to_posix(dt_str):
 (parsable, _) = dt_str.split('.')
 dt = datetime.datetime.strptime(parsable, _DT_FORMAT)
 return calendar.timegm(dt.utctimetuple())

def dt_str_to_posix ( dt_str ) : ( parsable , _ ) = dt_str . split ( '.' ) dt = datetime . datetime . strptime ( parsable , _DT_FORMAT ) return calendar . timegm ( dt . utctimetuple ( ) )
format str to posix .