class_docstr: A datetime trait type.
  
  Converts the passed date into a string format that can be used to
  construct a JavaScript datetime.
class_docstr_tok: ["A","datetime","trait","type",".","Converts","the","passed","date","into","a","string","format","that","can","be","used","to","construct","a","JavaScript","datetime","."]
code: def validate(self, obj, value):
      try:
          if isinstance(value, dt.datetime):
              return value
          if isinstance(value, dt.date):
              return dt.datetime(value.year, value.month, value.day)
          if np.issubdtype(np.dtype(value), np.datetime64):
              # TODO: Fix this. Right now, we have to limit the precision
              # of time to microseconds because np.datetime64.astype(datetime)
              # returns date values only for precision <= 'us'
              value_truncated = np.datetime64(value, "us")
              return value_truncated.astype(dt.datetime)
      except Exception:
          self.error(obj, value)
      self.error(obj, value)
  
imports: from traitlets import TraitError, TraitType
  import numpy
  import pandas
  import warnings
  import datetime
  import six
label_desc: Use image node_id 1 for calling the Date obj's underlying member method code with example usage: obj.validate(obj, value) and returns: value, dt, value_truncated