View Full Version : Resolved current year showing in a page
100pokerbonus
09-15-2014, 05:33 PM
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,
mlegg
09-15-2014, 11:18 PM
you can use this php code
http://www.w3schools.com/php/php_date.asp
Deadweight
09-15-2014, 11:25 PM
php:
<?php echo date("Y"); ?>
js:
var d = new Date();
var n = d.getFullYear();
molendijk
09-15-2014, 11:38 PM
In your case:
<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>
100pokerbonus
09-18-2014, 03:58 AM
this code (molendijk) works greatly, thanks
cosminlife
09-23-2014, 07:25 PM
<?php echo date('Y'); ?> for Wordpress!
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.