WordPress.org

Ready to get started?Download WordPress

Forums

the_time() outputting 2010? (3 posts)

  1. gotmedia
    Member
    Posted 3 years ago #

    Hi there,

    I've been doing the php:

    <?php the_time(); ?> and everytime I do it, it outputs "2010" as the year. Clearly, we're not in 2010 anymore. Why is this doing this? Anyway to fix it? I have the loop started, too.

    - Steph

  2. alchymyth
    The Sweeper & Moderator
    Posted 3 years ago #

    the_time() outputs the publish time of a post; if not used in the loop, the output can be arbitrary.

    if you want to output the current time, look into:
    echo date('Y');

    http://php.net/manual/en/function.date.php

  3. gotmedia
    Member
    Posted 3 years ago #

    Ah, still, that's weird! I'll use the PHP output from now on, thanks :)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.