
Originally Posted by
BLiZZaRD
You could use the <link rel type=print option in the head to make it so they print a page different than what they are actually seeing, you can then put the time code on this page.
I think you mean media, the type should be text/css for all stylesheet links:
Code:
<link rel="stylesheet" href="styles.css" media="screen" type="text/css">
<link rel="stylesheet" href="print.css" media="print" type="text/css">
Once you have separate print and screen stylesheets, you can use them to display only those portions of the document that you wish to for printing, and to format as desired for that purpose. The styles for the live (screen) page would go in the other stylesheet. You could have a division:
HTML Code:
<div id="printTime"> </div>
In your screen stylesheet, its display property could be none, in the print stylesheet, it could be block. When you go to print, just before the actual print command, do:
Code:
document.getElementById('printTime').firstChild.nodeValue=new Date().toLocaleString();
It will place the current date and time in the division, visible only to the printer and print preview.
Bookmarks