Last active
October 19, 2017 04:00
-
-
Save mariobox/6e1ad9ca38e2df5534b34b51a8310bde to your computer and use it in GitHub Desktop.
Last Updated Statement in User-Friendly Format
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Timestamp</title> | |
</head> | |
<!-- Start Page --> | |
<body> | |
<div> | |
<p id="lastUpdated"></p> | |
</div> | |
<!-- Custom JavaScript --> | |
<script src="lastupdated.js"></script> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var lastUpdated = new Date(document.lastModified); | |
var lastUpdatedString = lastUpdated.toString(); | |
var lastUpdatedArray = lastUpdatedString.split(' '); | |
document.getElementById('lastUpdated').innerHTML = '<p><strong>Last updated: </strong>' + lastUpdatedArray[1] + ' ' + lastUpdatedArray[2] + ' ' + lastUpdatedArray[3] + '</p></strong>' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment