code: public function setLastLogin($lastLogin)
      {
          if ($lastLogin instanceof DateTime) {
              $this->lastLogin = $lastLogin;
          } else {
              try {
                  $this->lastLogin = new DateTime($lastLogin);
              } catch (\Exception $e) {
                  $this->lastLogin = null;
              }
          }
  
          return $this;
      }
docs: Sets the "lastLogin" of the User.
  
  @param DateTime $lastLogin
  
  @return User