thanks
php and asp have an easy call for that for server time
but at the same time google will index the date
[PHP]
print date(“F j, Y, g:i a”);
?>[/PHP]
will make a format like this. March 10, 2001, 5:16 pm
for more information check PHP: date – Manual
well, what server do you use? adding that line in a html page will give you the output if your on php (linux)
Hi. Actually no, to add php code, the file must be .php
for .html there is only JavaScript solution, but I think Google don’t indexing JS.
If you want to get deeper we can have php parse html pages, and then have the ability to add php code in the .html
This worked on my GoDaddy Linux server but I know they configured it to parse server side includes (ssi).
I created a php file called stamp.php with chip’s php code below, nothing else. (upload it of course but I’d disallow it from getting crawled in the robots.txt file)
print date(“F j, Y, g:i a”);
?>
I made an html test page called test-stamp.html
Inside my test page I added a single line of code to include stamp.php.
Add the line of code below in your html pages where you want the date/time stamp to display:
I uploaded the test page (stamp-test.html) to my server and fetched it via Google Webmaster tools. Below is exactly how Googlebot sees it. I added a line of html
to show that Google reads raw html. First Google got the header info but after that you can see where the test HTML page starts. In bold you can see where the server delivered the output of stamp.php and not the code itself as it does with HTML and Javascript.
This is how Googlebot fetched the page.
URL: xhttp://www.slottipsguide.com//stamp-test.html
Date: Sat Sep 18 18:57:50 PDT 2010
Googlebot Type: Web
HTTP/1.1 200 OK
Date: Sun, 19 Sep 2010 01:57:50 GMT
Server: Apache
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html
September 18, 2010, 6:57 pm
Please login or Register to submit your answer