Quantcast
Channel: Adobe Community: Message List
Viewing all articles
Browse latest Browse all 83883

Re: "Date Last Edited" Automatically Updated on Save?

$
0
0

Sure, it's not built into DW though.

 

Here's a javascript that would do the trick. Copy this part into a new .js file and call it "date.js"...

 

months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];

var d = new Date();

var weekday = new Array(7);

weekday[0] = "Sunday";

weekday[1] = "Monday";

weekday[2] = "Tuesday";

weekday[3] = "Wednesday";

weekday[4] = "Thursday";

weekday[5] = "Friday";

weekday[6] = "Saturday";

 

var d = new Date();

(d.getFullYear());

 

var theDate = new Date(document.lastModified);

theDate.setTime((theDate.getTime()+(60*60)) )

with (theDate) {

document.write("<i>Last updated "+weekday[getDay()]+' '+months[getMonth()]+' '+getDate()+', '+d.getFullYear()+' @ '+getHours()+':'+getMinutes()+" DST</i>")

}

 

Here's a base html page that attaches to the date.js file. Place the bold part wherever you want the date to show in your page and make sure the "path-to" part is the actual path to your .js file...

 

<!doctype html>

<html lang="en-us">

<head>

<meta charset="utf-8">

<title>Add date from Last Modified of document</title>

</head>

 

<body>

<script src="path-to/date.js" script type="text/javascript"></script>

</body>

</html>


Viewing all articles
Browse latest Browse all 83883

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>