Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get Google docs last edit date

I am working on an app in which I need to show the date when google doc was last edited.

Snapshot Here

I am able to get last modified date through Drive api

But it is different from last edited date for cases when file's metadata (e.g. permission) has changed and content hasn't.

Is there any way to get date when google doc was last edited?

like image 895
Saurabh Sharma Avatar asked Dec 04 '14 09:12

Saurabh Sharma


1 Answers

In Google Apps Script there is a DriveApp service that you can use. Something like this will work:

function lastUpdatedOn() {
  var FILE_ID = 'FILEID';

  return DriveApp.getFileById(FILE_ID).getLastUpdated();
}

The documentation for that is here: https://developers.google.com/apps-script/reference/drive/file#getlastupdated

Hope that helps.

like image 136
Jordan Rhea Avatar answered Sep 28 '22 09:09

Jordan Rhea