code: def datetime(self, field=None, val=None):
          
          if val is None:
              def source():
                  tzinfo = get_default_timezone() if settings.USE_TZ else None
                  return datetime.fromtimestamp(randrange(1, 2100000000),
                                                tzinfo)
          else:
              def source():
                  tzinfo = get_default_timezone() if settings.USE_TZ else None
                  return datetime.fromtimestamp(int(val.strftime("%s")) +
                                                randrange(-365*24*3600*2, 365*24*3600*2),
                                                tzinfo)
          return self.get_allowed_value(source, field)
docs: Returns a random datetime. If 'val' is passed, a datetime within two
          years of that date will be returned.