Results 1 to 6 of 6

Thread: current year showing in a page

  1. #1
    Join Date
    Sep 2014
    Posts
    2
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default current year showing in a page

    Hello I have been looking for some codes that I can display the current year on a page. For example: currently I put "all year 2014" on my pages, i would like that the "2014" automatically changes to "2015" next year, and "2016....so on"....

    In case I did not write clearly, please check the page "www.100pokerbonus.com/?p=274" for details, thank you.

    Best,

  2. #2
    Join Date
    Jan 2009
    Location
    NH
    Posts
    675
    Thanks
    98
    Thanked 26 Times in 26 Posts

    Default

    you can use this php code
    http://www.w3schools.com/php/php_date.asp

  3. The Following User Says Thank You to mlegg For This Useful Post:

    100pokerbonus (09-18-2014)

  4. #3
    Join Date
    Mar 2010
    Location
    Florida
    Posts
    512
    Thanks
    9
    Thanked 61 Times in 59 Posts

    Default

    php:
    PHP Code:
    <?php echo date("Y"); ?>
    js:
    Code:
    var d = new Date();
    var n = d.getFullYear();
    -DW [Deadweight]
    Resolving your thread: First Post: => EDIT => Lower right: => GO ADVANCED => Top Advance Editor drop down: => PREFIX:Resolved

  5. The Following User Says Thank You to Deadweight For This Useful Post:

    100pokerbonus (09-18-2014)

  6. #4
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,881
    Thanks
    49
    Thanked 266 Times in 258 Posts
    Blog Entries
    56

    Default

    In your case:
    Code:
    <li class="fusion-li-item size-small">
    <span class="icon-wrapper circle-no">
    <i class="fusion-li-icon fa fa-fa fa-angle-double-right" style="color:green;"></i>
    </span>
    <span id="year" class="fusion-li-item-content">
    Date: 
    <script type="text/javascript">
    document.getElementById('year').innerHTML='Date: '+'<b>All Year '+new Date().getFullYear()+'<\/b>';
    </script>
    </span>
    </li>

  7. The Following User Says Thank You to molendijk For This Useful Post:

    100pokerbonus (09-18-2014)

  8. #5
    Join Date
    Sep 2014
    Posts
    2
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    this code (molendijk) works greatly, thanks

  9. #6
    Join Date
    Sep 2014
    Location
    Bucharest
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    <?php echo date('Y'); ?> for Wordpress!

Similar Threads

  1. Resolved How to load a new page when current page has loaded
    By ff123 in forum JavaScript
    Replies: 3
    Last Post: 04-19-2009, 03:01 PM
  2. DD Tab Menu: tabs not showing current URL
    By fenix_ds in forum Dynamic Drive scripts help
    Replies: 1
    Last Post: 02-26-2009, 08:21 AM
  3. show year in html page
    By AndyK in forum PHP
    Replies: 9
    Last Post: 01-09-2008, 10:22 PM
  4. css current page
    By neilkw in forum CSS
    Replies: 5
    Last Post: 08-29-2006, 04:24 PM
  5. Current Page
    By nikomou in forum PHP
    Replies: 3
    Last Post: 07-24-2006, 01:14 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •