[resolved] php echo the_time('Y') (3 posts)

  1. Ramzii
    Posted 3 years ago #

    This php code should generate the current year were living in right?

    <?php echo the_time('Y');?>

    But it still gives 2012?

    I think it has something to do with the hosting server.. any clue? Thanks!

  2. Phil
    Posted 3 years ago #

    Try this:

    <?php echo date("Y")?>

    the_time references the publish time of the post/page and gives inconsistent values when used outside loops. the_date should be used in templates/footers etc.

  3. Ramzii
    Posted 3 years ago #

    I love you.

Topic Closed

This topic has been closed to new replies.

About this Topic