ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

raw date format? how is it stored?

January 24, 2010 6:08pm

Subscribe [3]
  • #1 / Jan 24, 2010 6:08pm

    RyanMills

    63 posts

    For example the date “2010-01-28 12:47 PM” is stored as “1264740458”. If I wanted to take a date and format it that way with PHP by hand how would I do it?

  • #2 / Jan 24, 2010 7:30pm

    lebisol

    2234 posts

    You can apply date format before handed to PHP.

  • #3 / Jan 24, 2010 8:12pm

    RyanMills

    63 posts

    i need the reverse, i.e. how is the number that EE stores created?

  • #4 / Jan 24, 2010 10:08pm

    Focus Lab Dev Team

    1129 posts

    That’s a unix timestamp (time since epoch)

    To get that value of the current time in php you can just use

    <?php
    
    // set your timezone if it isn't already set
    date_default_timezone_set('EST');
    // display unix timestamp
    echo date('U');
    
    ?>
  • #5 / Jan 24, 2010 10:09pm

    RyanMills

    63 posts

    That’s a unix timestamp (time since epoch)

    To get that value of the current time in php you can just use

    <?php
    
    // set your timezone if it isn't already set
    date_default_timezone_set('EST');
    // display unix timestamp
    echo date('U');
    
    ?>


    thanks that’s exactly what I needed.

  • #6 / Jan 24, 2010 10:10pm

    Focus Lab Dev Team

    1129 posts

    Awesome. Glad to help Ryan 😊

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases