非标
此特征是非标准的,且不在标准轨道中。不要在面向 Web 的生产站点中使用它:它不适用于每个用户。实现之间可能存在大的不兼容性,且行为将来可能改变。

只读 modificationTime 特性为 元数据 接口是 日期 object which specifies the date and time the file system entry (or the data referenced by the entry) was last modified. A file system entry is considered to have been modified if the metadata or the contents of the referenced file (or directory, or whatever other kind of file system entry might exist on the platform in use) has changed.

句法

var modificationTime = Metadata.modificationTime;
					

A 日期 timestamp indicating when the file system entry was last changed.

范例

This example tries to get a particular working file at tmp/workfile.json . Once that file has been found, its metadata is obtained and the file's modification timestamp year is compared to the current year. If it was last modified in a year at least five prior to the current year, the file is removed and a new one is created.

workingDirectory.getFile("tmp/workfile.json", { create: true }, function(fileEntry) {
  fileEntry.getMetadata(function(metadata) {
    if ((new Date().getFullYear() - metadata.modificationTime.getFullYear()) >= 5) {
      fileEntry.remove(function() {
        workingDirectory.getFile("tmp/workfile.json", { create: true }, function(newEntry) {
          fileEntry = newEntry;
        });
      });
    }
  });
}, handleError);
					

此 API 没有正式的 W3C 或 WHATWG (Web 超文本应用程序技术工作组) 规范。

浏览器兼容性

The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. 更新 GitHub 上的兼容性数据
桌面 移动
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
modificationTime 非标 Chrome 13 Edge ≤79 Firefox No IE No Opera No Safari No WebView Android No Chrome Android Yes Firefox Android No Opera Android No Safari iOS No Samsung Internet Android Yes

图例

完整支持

完整支持

不支持

不支持

实验。期望将来行为有所改变。

实验。期望将来行为有所改变。

非标。预期跨浏览器支持较差。

非标。预期跨浏览器支持较差。

另请参阅

元数据

  • 最后修改: