Skip to:
Content
Pages
Categories
Search
Top
Bottom

Importing: Date Format and mapping help

  • @ahau

    Participant

    Hi,

    I am moving an old site to WP and bbPress and need to convert my old forums. I understand I need to use the example.php in the converter folder and write a converter for each old forum – there are 3 I am gong to convert.

    And wouldn’t you know it, the 3 different forums use 3 different date formats!

    Here they are
    1415922411
    2004-09-13 19:25:59
    20080407181855

    From looking around in all of the converter files I see that forum dates are done 2 ways

    In example converter – I am guessing that I would use this format to convert the date like 20080407181855 ?

    // Forum dates.
    $this->field_map[] = array(
    'to_type' => 'forum',
    'to_fieldname' => 'post_date',
    'default' => date('Y-m-d H:i:s')
    );

    In vanilla converter – I am guessing I would use this format to convert the date like 2004-09-13 19:25:59 ?

    // Forum dates.
    $this->field_map[] = array(
    'from_tablename' => 'Category',
    'from_fieldname' => 'DateInserted',
    'to_type' => 'forum',
    'to_fieldname' => 'post_date',
    );

    Anyone know how I can convert a date such as 1415922411 to the correct date format – which I am guessing is Y-m-d H:i:s?

    Thank you for your time.

Viewing 2 replies - 1 through 2 (of 2 total)
  • @robin-w

    Moderator

    ok, bbpress expects the format yyyy-mm-dd hh:mm:ss

    When I did a custom conversion, I found it much easier to convert the source to the correct format and then import, rather than try and do it on the fly.

    so if you create a new field in your original tables, then you can put the required format in there.

    @ahau

    Participant

    Perfect – thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Skip to toolbar