Home  >  Article  >  Web Front-end  >  Example of a simple JS method to view document creation date, modification date and document size

Example of a simple JS method to view document creation date, modification date and document size

亚连
亚连Original
2018-05-26 09:58:592103browse

This article mainly introduces the simple method of JS to view the document creation date, modification date and document size. It analyzes the related operation skills of JavaScript using fileCreatedDate attribute, fileModifiedDate attribute, lastModified attribute and fileSize attribute in the form of examples. Friends who need it You can refer to the following

The example of this article describes the simple method of viewing the document creation date, modification date and document size using JS. Share it with everyone for your reference, the details are as follows:

1 Introduction

To view the document creation date, modification date and document size, you can use fileCreatedDate property, fileModifiedDate property, lastModified property and fileSize property.

fileCreatedDateAttribute

This attribute is used to obtain the creation date of the document.

Syntax:

[date=]fileCreatedDate

date: String variable used to store the creation date of the document . date is optional.

fileModifiedDateAttribute

This attribute is used to obtain the last modified date of the document.

Syntax:

[date=]fileModifiedDate

date: String variable used to store the last modification of the document date. date is optional.

lastModifiedAttribute

This attribute is used to obtain the last modification time of the document.

Syntax:

[date=]lastModified

##date: String variable used to store the last modification of the document time. date is optional.

fileSizeAttribute

This attribute is used to obtain the size of the document.

Syntax:

[size=]fileSize

size: String variable used to store the document size. size is optional.

Second Application

View the document creation date, modification date and document size

This example displays the The document's creation date, modification date, and document size.

Three codes

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>www.jb51.net 查看文件创建时间、修改时间和文档大小</title>
</head>
<body>
查看文件创建时间、修改时间和文档大小<br>
<script lanage="javaScript">
<!--
document.write("<b>该文档创建日期: </b>"+document.fileCreatedDate+"<br>");
document.write("<b>该文档修改日期: </b>"+document.fileModifiedDate+"<br>");
document.write("<b>该文档修改时间: </b>"+document.lastModified+"<br>");
document.write("<b>该文档大小: </b>"+document.fileSize+"<br>");
-->
</script>
</body>
</html>

Four running results

#The above is what I compiled for everyone. I hope it will be helpful to everyone in the future.

Related articles:

Use ajax to preview the link and you can see the content of the link

In (ASP/PHP/ A collection of methods to disable ajax caching in JSP/html/js)

Use Ajax technology to complete the home page login function through the XMLHttpRequest object

The above is the detailed content of Example of a simple JS method to view document creation date, modification date and document size. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn