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.

Date stamp in db

May 26, 2009 11:20am

Subscribe [5]
  • #1 / May 26, 2009 11:20am

    peaston

    14 posts

    In the db for EE what format is the date/time stored?
    in table “exp_weblog_titles” field “entry_date” there is what appears to be a unix timestamp but if i use any php converters i get the wrong information.
    ie:
    an entry date in ee andmin is 2009-05-21 11:00 PM
    in the field it is 1242975601
    php conversion is 22 May 2009 08:00:01 AM

    I’m writing a script that builds an iCal file for a weblog entry but the time/date error keeps putting it in the wrong place.

    any assistance is welcome
    Pete

  • #2 / May 26, 2009 11:26am

    Mark Bowen

    12637 posts

    Hi Pete,

    I’m not fantastic on these types of things but the dates are indeed stored as a UNIX timestamp. It may be that you need to apply the localisation class to the timestamps to get at exactly what you need.

    Seems like you are nine hours out somewhere. Usually a localisation thing.

    Best wishes,

    Mark

  • #3 / May 26, 2009 1:22pm

    lebisol

    2234 posts

    I think Mark is spot on…also you can use the converter to quickly view readable time stamp.

  • #4 / May 27, 2009 9:43am

    peaston

    14 posts

    Thanks for the info and i will look into it but i don’t think that’s my problem.
    The script that i’m calling is completely external from ee, it’s a php script that call directly to the ee db, all i pass to the script is the weblog entry id and the script does all the rest. While they all live on the same test server the server is set to the correct timezone and ee is also set to the correct tz when i convert the timestamp it comes out wrong. Even if i use the on line converters i get the wrong answer….

    i’m stumped.

    thanks again for all your help
    Pete

  • #5 / May 27, 2009 9:53am

    Ingmar

    29245 posts

    It is a UNIX timestamp, and as such in UTC. You’ll need to convert to your target TZ manually.

  • #6 / May 27, 2009 9:59am

    silenz

    1651 posts

    Thanks for the info and i will look into it but i don’t think that’s my problem.
    The script that i’m calling is completely external from ee,

    But EE is not external from EE 😉 The timestamp saved in the DB is not necessarily identical with the date displayed in EE’s control panel.

    Is your user account (CP Home ›  My Account ›  Localization Settings ) set to the same timezone as your server?

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

ExpressionEngine News!

#eecms, #events, #releases