如何获取Google文档的上次编辑日期 [英] How to get Google docs last edit date

查看:156
本文介绍了如何获取Google文档的上次编辑日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个应用程序,在该应用程序中,我需要显示Google文档的上次编辑日期.

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

此处的快照

我能够通过 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.

有什么方法可以获取上次修改Google文档的日期?

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

推荐答案

在Google Apps脚本中,可以使用DriveApp服务.这样的事情会起作用:

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();
}

此处的文档位于: https://developers. google.com/apps-script/reference/drive/file#getlastupdated

希望有帮助.

这篇关于如何获取Google文档的上次编辑日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆