Forums

Need help with complex date formatting (5 posts)

  1. lalindsey
    Member
    Posted 4 years ago #

    Hi, I'm designing a template for a client.

    He wants his date to display like it does on a site like http://mezzoblue.com

    So he wants the date to be like this:

    NOV
    15

    I'm unable to figure out how to do this, as I don't have the php experience to do this. Can anyone help me?

    Basically this is what I would need it to look like (the HTML)

    <div class="calPage">Nov
    <div class="day">15</div>
    </div>

    What is the PHP that I need to put in the section which is now "Nov" to call the month in that format, and than what do I need to put so the date displays within that div.

    Thanks so much for any help in advance.

    BTW this is what it looks like statically:

    http://triplelproductions.com/demos/leon

  2. Beel
    Member
    Posted 4 years ago #

    <span class="month"><?php the_time('m') ?><span class="day"><?php the_time('d') ?></span></span>

    Style it how you want (you may want to use div instead of span).

  3. lalindsey
    Member
    Posted 4 years ago #

    Ok, I'll try that, thanks alot.

  4. lalindsey
    Member
    Posted 4 years ago #


  5. lalindsey
    Member
    Posted 4 years ago #

    Great that worked! I was using the wrong function and that was why it wasn't working (using the_date('M')) instead of time. THANKS!

Topic Closed

This topic has been closed to new replies.

About this Topic