I would like to change the permissions of a Google Drive file with the PHP api client. Now my problem is that it doesn't set the expiration time. The user permission is successful.
The documentation says that I need to pass the date RFC3339 formatted but I'm doing that. What's wrong with this code?
$service = new Google_Service_Drive($client);
$permission = new Google_Service_Drive_Permission();
$permission->setRole('reader');
$permission->setType('user');
$permission->setEmailAddress('someone@gmail.com');
$permission->setExpirationTime(date(DateTime::RFC3339, time() + 86400));
$createPermissions = $service->permissions->create(
$uploadedFileId,
$permission
);
I hope someone can help me :)
Thanks!