def fallback_humanize(date, fallback_format=None, use_fallback=False):
 date = arrow.get(date).to('local')
 if (not fallback_format):
  fallback_format = '%Y/%m/%d %H:%M:%S'
 if use_fallback:
  return date.datetime.strftime(fallback_format)
 try:
  (lang, encode) = locale.getdefaultlocale()
  clock = date.humanize(locale=lang)
 except:
  if (not dg['humanize_unsupported']):
   dg['humanize_unsupported'] = True
   printNicely(light_magenta('Humanized date display method does not support your $LC_ALL.'))
  clock = date.datetime.strftime(fallback_format)
 return clock

def fallback_humanize ( date , fallback_format = None , use_fallback = False ) : date = arrow . get ( date ) . to ( 'local' ) if ( not fallback_format ) : fallback_format = '%Y/%m/%d %H:%M:%S' if use_fallback : return date . datetime . strftime ( fallback_format ) try : ( lang , encode ) = locale . getdefaultlocale ( ) clock = date . humanize ( locale = lang ) except : if ( not dg [ 'humanize_unsupported' ] ) : dg [ 'humanize_unsupported' ] = True printNicely ( light_magenta ( 'Humanized date display method does not support your $LC_ALL.' ) ) clock = date . datetime . strftime ( fallback_format ) return clock
format date with arrow and a fallback format .