Get best price on Unlocked Samsung Galaxy A21 | ||||||||||||
|
||||||||||||
|
JavaScript: Date FunctionsAutomatically display the date a web page or file was last modified. This is useful because when you change a file, your web page displays a new date without any changes to HTML. The document object has a last modified date property. Here's the code:
<SCRIPT LANGUAGE="JavaScript">
<!-- document.write(document.lastModified); //--> </SCRIPT> This displays: Improving The Format of the Date Displayed
Create a Date Object out of the
<SCRIPT LANGUAGE="JavaScript">
<!-- myDate = new Date(document.lastModified); displayDate = myDate.getMonth()+1 + "-" + myDate.getDate() document.writeln("Last Modifed: " + displayDate) //--> </SCRIPT> This displays: More Date Formatting Functions
which is good for avoiding confusion over which number is the day and which number is the month. This confusion is best avoided because some countries display dates as day/month/year rather than month/day/year. Two things to remember when using JavaScript dates:
|
privacy policy || © 1997-2016. astonishinc.com All Rights Reserved. |