original_docstring: Convert datetime to string formatted as YYYY-MM-DD, per JSON Schema specs.
docstring: Convert datetime to string formatted as YYYY-MM-DD, per JSON Schema specs.
docstring_tokens: Convert datetime to string formatted as YYYY - MM - DD per JSON Schema specs .
code: def convert_to_json_date(thedate: datetime.datetime) -> str:
      """Convert datetime to string formatted as YYYY-MM-DD, per JSON Schema specs."""
      if not thedate:
          return None
      try:
          utcdate = datetime.datetime(thedate.year,
                                      thedate.month,
                                      thedate.day,
                                      thedate.hour,
                                      thedate.minute,
                                      thedate.second,
                                      tzinfo=timezone('UTC'))
          return utcdate.strftime('%Y-%m-%d')
      except Exception as err:  # pylint: disable=broad-except; want to return None in all cases where convert failed
          current_app.logger.debug('Tried to convert {date}, but failed: {error}'.format(date=thedate, error=err))
          return None
code_tokens: def convert_to_json_date ( thedate : datetime . datetime ) -> str : if not thedate : return None try : utcdate = datetime . datetime ( thedate . year , thedate . month , thedate . day , thedate . hour , thedate . minute , thedate . second , tzinfo = timezone ( 'UTC' ) ) return utcdate . strftime ( '%Y-%m-%d' ) except Exception as err : current_app . logger . debug ( 'Tried to convert {date}, but failed: {error}' . format ( date = thedate , error = err ) ) return None
short_docstring: Convert datetime to string formatted as YYYY-MM-DD, per JSON Schema specs.
short_docstring_tokens: Convert datetime to string formatted as YYYY - MM - DD per JSON Schema specs .
comment: """Convert datetime to string formatted as YYYY-MM-DD, per JSON Schema specs."""$SEP$# pylint: disable=broad-except; want to return None in all cases where convert failed