Forum Moderators: coopster & phranque

Message Too Old, No Replies

how to add Date&Time in html?

         

masterpp

5:08 pm on Apr 27, 2004 (gmt 0)

10+ Year Member


is there a way to add Date & Time in the HTML file (in comment code)? So that I can check when is the cached page google has crawled. If i use javascript date, i don't think google will take that date.

Like I did with PHP files, i use this
<?PHP echo "<!-- ". date("l M j g:i:s a Y" ) ." -->";?>

jbgilbert

5:37 pm on Apr 27, 2004 (gmt 0)

10+ Year Member


try this....

<script language="JavaScript1.2">
<!-- Begin
var months=new Array(13);
months[1]="January";
months[2]="February";
months[3]="March";
months[4]="April";
months[5]="May";
months[6]="June";
months[7]="July";
months[8]="August";
months[9]="September";
months[10]="October";
months[11]="November";
months[12]="December";
var time=new Date();
var lmonth=months[time.getMonth() + 1];
var date=time.getDate();
var year=time.getYear();
if (year < 2000)
year = year + 1900;
document.write("<right>" + lmonth + " ");
document.write(date + ", " + year + "</right>");
// End -->
</script>

[1][[b]edited by[/b]: jatar_k at 2:16 am (utc) on April 28, 2004][/1]
[1][edit reason] removed url [/edit][/1]

jbgilbert

5:38 pm on Apr 27, 2004 (gmt 0)

10+ Year Member



whoops.... sorry.... I should have read closer.

If you want to know when Google crawls, monitor your log files.

masterpp

7:42 pm on Apr 27, 2004 (gmt 0)

10+ Year Member



I guess SSI might be a way to put date on page.

jjohnstn

5:39 am on Apr 28, 2004 (gmt 0)

10+ Year Member



<!--#config timefmt="%b %e, %Y - %I:%M %p %Z"-->
<!--#echo var="DATE_LOCAL"-->

will give you Apr 28, 2004 - 01:36 AM EDT
well, time and date will be different by then :)

A Google search should provide you with the formatting codes.

Also see: [httpd.apache.org...]