Anyone Know Of A Free Time (Year) Script?

5 replies
Hi,

I'm looking for a time script that updates the year automatically in the website's copyright notice.

Do you know of any free ones to recommend? Thanks.
#free #script #time #year
  • Profile picture of the author Dan Grossman
    Code:
    <?php echo date('Y'); ?>
    will print the current year.
    Signature
    Improvely: Built to track, test and optimize your marketing.

    {{ DiscussionBoard.errors[7180301].message }}
    • Profile picture of the author solidim
      Thanks for the post...... but doesn't work.

      Don't know if I did something wrong, I just pasted the code and it doesn't show the year in the browser.
      {{ DiscussionBoard.errors[7180824].message }}
      • Profile picture of the author Dan Grossman
        Originally Posted by solidim View Post

        Thanks for the post...... but doesn't work.

        Don't know if I did something wrong, I just pasted the code and it doesn't show the year in the browser.
        What does it show? Did you paste it in a PHP file?

        You haven't shared any information about your website. What CMS or software did you use to build it? What language is it written in?

        It wouldn't be useful for me to give you Java code if your site runs on ASP.NET.
        Signature
        Improvely: Built to track, test and optimize your marketing.

        {{ DiscussionBoard.errors[7180858].message }}
        • Profile picture of the author solidim
          Oh thanks,

          I wish to put the time script in a html page. I use dreamweaver software.

          Is there a good script for it?
          {{ DiscussionBoard.errors[7183433].message }}
  • Profile picture of the author Dan Grossman
    You could use JavaScript...

    Code:
    <script>document.write(new Date().getFullYear())</script>
    But then nothing will show up for search engines and browsers with JavaScript disabled. Is it a big deal to rename your file .php and run some PHP code (server-side) to print the date in the HTML? Virtually all web hosts support that language with no configuration.
    Signature
    Improvely: Built to track, test and optimize your marketing.

    {{ DiscussionBoard.errors[7187384].message }}

Trending Topics