Forums

[resolved] current time in 12 hours format (4 posts)

  1. yashmistrey
    Member
    Posted 9 months ago #

    hi i want to display current date & time on blog header

    i using these code

    <?php echo date('G:ia',current_time('timestamp',0)); ?>
    <?php the_time('l, jS F, Y') ?>

    result = 21:19pm Friday, 19th August, 2011

    it should be = 9:19 pm Friday, 19th August, 2011

    i want the time in 12 hrs format

    how to do that ?

  2. esmi
    Theme Diva & Forum Moderator
    Posted 9 months ago #

    <?php echo date('g:ia',current_time('timestamp',0)); ?>
    http://uk2.php.net/manual/en/function.date.php

  3. yashmistrey
    Member
    Posted 9 months ago #

    thanks Esmi
    done

    thanks a lot

  4. esmi
    Theme Diva & Forum Moderator
    Posted 9 months ago #

    Glad I could help.

Reply

You must log in to post.

About this Topic