def _convertTime(title, fromPTDFtoWEB=1, _emptyString=u''):
 try:
  if fromPTDFtoWEB:
   from_format = _ptdf_format
   to_format = _web_format
  else:
   from_format = (u'Episode dated %s' % _web_format)
   to_format = _ptdf_format
  t = strptime(title, from_format)
  title = strftime(to_format, t)
  if fromPTDFtoWEB:
   if (title[0] == '0'):
    title = title[1:]
   title = (u'Episode dated %s' % title)
 except ValueError:
  pass
 if isinstance(_emptyString, str):
  try:
   title = str(title)
  except UnicodeDecodeError:
   pass
 return title

def _convertTime ( title , fromPTDFtoWEB = 1 , _emptyString = u'' ) : try : if fromPTDFtoWEB : from_format = _ptdf_format to_format = _web_format else : from_format = ( u'Episode dated %s' % _web_format ) to_format = _ptdf_format t = strptime ( title , from_format ) title = strftime ( to_format , t ) if fromPTDFtoWEB : if ( title [ 0 ] == '0' ) : title = title [ 1 : ] title = ( u'Episode dated %s' % title ) except ValueError : pass if isinstance ( _emptyString , str ) : try : title = str ( title ) except UnicodeDecodeError : pass return title
convert a time expressed in the pain text data files .