@core_helper
def render_datetime(datetime_, date_format=None, with_hours=False):
 datetime_ = _datestamp_to_datetime(datetime_)
 if (not datetime_):
  return ''
 if date_format:
  return datetime_.strftime(date_format)
 return formatters.localised_nice_date(datetime_, show_date=True, with_hours=with_hours)

@ core_helper def render_datetime ( datetime_ , date_format = None , with_hours = False ) : datetime_ = _datestamp_to_datetime ( datetime_ ) if ( not datetime_ ) : return '' if date_format : return datetime_ . strftime ( date_format ) return formatters . localised_nice_date ( datetime_ , show_date = True , with_hours = with_hours )
render a datetime object or timestamp string as a localised date or in the requested format .