Get exclusive CAP network offers from top brands

View CAP Offers

Time and date code

Shotgunpete asked 3 years ago
Any one have a time and date code that google (et all) can read the date?

thanks

9 Answers
allfreechips answered 3 years ago
you mean just print time?

php and asp have an easy call for that for server time

Shotgunpete answered 3 years ago
I mean when people come to a web page and see the date and time

but at the same time google will index the date

allfreechips answered 3 years ago
you can add this

[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

Shotgunpete answered 3 years ago
Thanks for your help but I was looking for html code ( I guess I should have said that)

allfreechips answered 3 years ago
well, what server do you use? adding that line in a html page will give you the output if your on php (linux)

ALEX777 answered 3 years ago
@allfreechips 222363 wrote:

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.

allfreechips answered 3 years ago
well, true you got me ther lol, i use php to process html pages as well, but then were getting deep. as for a true html solution i cant think of any as you can not script it, and java of course wont be proccesed by a se.

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

slotplayer answered 3 years ago
I believe Bots only read raw code so client side languages like javascript and html won’t work as its the browser that actually executes it.

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







date from included stamp.php



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

date from included stamp.php

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






date from included stamp.php

September 18, 2010, 6:57 pm


ALEX777 answered 3 years ago
slotplayer: Server Side Includes (SSI) – great solution!!! (I totally forgot about it :banger.

And I think this method is good for many useful things <span title=” title=”” class=”bbcode_smiley” />

Thanks!