code: def to_timestamp(val):
      
      # If we're given a number, give it right back - it's already a timestamp.
      if isinstance(val, numbers.Number):
          return val
      elif isinstance(val, six.string_types):
          dt = _parse_datetime_string(val)
      else:
          dt = val
      return time.mktime(dt.timetuple())
docs: Takes a value that is either a Python date, datetime, or a string
      representation of a date/datetime value. Returns a standard Unix timestamp
      corresponding to that value.