Get exclusive CAP network offers from top brands

View CAP Offers

Time and date code

[bsa_pro_ad_space id=2]
  • This topic is empty.
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #622753
    winner.com
    Member

    Any one have a time and date code that google (et all) can read the date?

    thanks

    #812230
    Anonymous
    Inactive

    you mean just print time?

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

    #812231
    winner.com
    Member

    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

    #812258
    Anonymous
    Inactive

    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

    #812262
    winner.com
    Member

    Thanks for your help but I was looking for html code ( I guess I should have said that)

    #812264
    Anonymous
    Inactive

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

    #812274
    Anonymous
    Inactive

    @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.

    #812278
    Anonymous
    Inactive

    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

    #812279
    Anonymous
    Inactive

    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


    #812312
    Anonymous
    Inactive

    slotplayer: Server Side Includes (SSI) – great solution!!! (I totally forgot about it :banger:).

    And I think this method is good for many useful things :D

    Thanks!

Viewing 10 posts - 1 through 10 (of 10 total)