parameters: (value)
return_statement: return datetime.strptime(value, DATETIME_FORMAT[:len(value)-2])
docstring: Convert an ORM ``value`` into a :class:`datetime` value.
  
          :param value: value to convert.
          :type value: str or date or datetime
          :return: an object representing ``value``.
          :rtype: datetime or None
docstring_summary: Convert an ORM ``value`` into a :class:`datetime` value.
docstring_tokens: Convert an ORM value into a : class : datetime value .
function: def to_datetime(value):
          """Convert an ORM ``value`` into a :class:`datetime` value.
  
          :param value: value to convert.
          :type value: str or date or datetime
          :return: an object representing ``value``.
          :rtype: datetime or None
          """
          if not value:
              return None
          if isinstance(value, date):
              if isinstance(value, datetime):
                  if value.tzinfo:
                      raise ValueError("Datetime field expects a naive datetime: %s" % value)
                  return value
              return datetime.combine(value, time.min)
  
          # TODO: fix data files
          return datetime.strptime(value, DATETIME_FORMAT[:len(value)-2])
function_tokens: def to_datetime ( value ) : if not value : return None if isinstance ( value , date ) : if isinstance ( value , datetime ) : if value . tzinfo : raise ValueError ( "Datetime field expects a naive datetime: %s" % value ) return value return datetime . combine ( value , time . min ) # TODO: fix data files return datetime . strptime ( value , DATETIME_FORMAT [ : len ( value ) - 2 ] )