class_docstr: Validate and parse dates using the `dateutil` package.
docstr: Return a dictionary of string keys and integer values for `year`,
  `month` (from 0 - 11), and `day`.
  
  This method converts both datetime.date and numpy.datetime64 objects
  that contain datetime.date.
docstr_tok: ["Return","a","dictionary","of","string","keys","and","integer","values","for","`","year","`",",","`","month","`","(","from","0","-","11",")",",","and","`","day","`",".","This","method","converts","both","datetime.date","and","numpy.datetime64","objects","that","contain","datetime.date","."]
code: def to_date_components(self, obj):
      """Return a dictionary of string keys and integer values for `year`,
      `month` (from 0 - 11), and `day`.
  
      This method converts both datetime.date and numpy.datetime64 objects
      that contain datetime.date.
      """
      if obj is None:
          return obj
  
      if isinstance(obj, (int, float)):
          obj = datetime.fromtimestamp(_normalize_timestamp(obj) / 1000)
  
      if isinstance(obj, numpy.datetime64):
          if str(obj) == "NaT":
              return None
          obj = obj.astype(datetime)
  
          if isinstance(obj, int):
              obj = datetime.fromtimestamp(obj / 1000000000)
  
      # Perspective stores month in `t_date` as an integer [0-11],
      # while Python stores month as [1-12], so decrement the Python value
      # before Perspective attempts to use it.
      return {"year": obj.year, "month": obj.month - 1, "day": obj.day}
  
file_path: perspective/python/perspective/perspective/table/_date_validator.py
imports: import numpy
  from calendar import timegm
  from datetime import date, datetime
  from dateutil.parser import parse
  from pytz import UTC
  from pandas import Period
  from re import search
  from time import mktime
  from .libpsppy import t_dtype
label_desc: Use image node_id 2 for calling the _PerspectiveDateValidator obj's underlying member method code with example usage: obj.to_date_components(obj) and returns: dict, obj, None