• Resolved mcloone

    (@mcloone)


    Hey, is there a way to manipulate the date other than exploding?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Chester McLaughlin

    (@chetmac)

    This is un-tested code, but it’s how I use it:

    
    <?php
    $event = $post->AirpressCollection[0];
    $sDate = new DateTime($event["Start"]);
    $eDate = new DateTime($event["End"]);
    echo $sDate->format("Y-m-d H:i:s");
    echo $eDate->format("Y-m-d H:i:s");
    ?>
    

    Is that what you’re asking? If not, show me what you currently do and I’ll try again.

    More date formatting options here:
    https://php.net/manual/en/function.date.php

    Thread Starter mcloone

    (@mcloone)

    Ahh got it, I forgot I could just turn it into a date object hah

    • This reply was modified 8 years ago by mcloone.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Date manipulations’ is closed to new replies.