def getDateStr(format='%Y_%b_%d_%H%M'):
 now = time.strftime(format, time.localtime())
 try:
  now_decoded = codecs.utf_8_decode(now)[0]
 except UnicodeDecodeError:
  now_decoded = time.strftime('%Y_%m_%d_%H%M', time.localtime())
 return now_decoded

def getDateStr ( format = '%Y_%b_%d_%H%M' ) : now = time . strftime ( format , time . localtime ( ) ) try : now_decoded = codecs . utf_8_decode ( now ) [ 0 ] except UnicodeDecodeError : now_decoded = time . strftime ( '%Y_%m_%d_%H%M' , time . localtime ( ) ) return now_decoded
uses time .