• Resolved Adrian

    (@adriandw)


    New user, testing import/export links to csv.
    In the exported CSV, the Updated date column for an entry I updated today contains 10 September in the format 10/09/2020

    If I reimport the same file without change, and view all links the display says
    Publication Date: Published 2020/09/10 at 12:36 pm
    Updated: 2020-10-09 00:00 ** RECENTLY UPDATED **

    Somehow the Updated date which was exported in dd/mm/yyyy format has been interpreted on import as mm/dd/yyyy.
    Is this a bug or is there a setting I should change?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Yannick Lefebvre

    (@jackdewey)

    Thanks for the feedback. I’ll investigate this evening.

    Plugin Author Yannick Lefebvre

    (@jackdewey)

    I am a bit puzzled by your question. You are saying that the Updated Date – Empty for None column has the 10/09/2020 format in your exported CSV file. However, my code specifically formats the date as Y-m-d in the plugin:

    $link_object['Updated Date - Empty for none'] = date( 'Y-m-d', intval( get_post_meta( get_the_ID(), 'link_updated', true ) ) );

    I just ran a test for links created recently and got dates like 2020-09-03. The only date in the CSV file is with hyphens, not slashes. What did you open the CSV file in? Excel? It may be that Excel got confused by the date format and jumbled the date information.

    I would suggest either trying to open the file up in a text editor like Notepad++, or perhaps LibreOffice Calc.

    Let me know if you still need assistance on the issue. If you decide to use Link Library as a regular feature on your site, please consider donating to support this plugin’s development.

    Thread Starter Adrian

    (@adriandw)

    Thank you, you’re correct.
    Excel is trying to be too smart.
    I think it recognises the Updated Date field as a date and reformats it to dd/mm/yyyy on input.
    Then if I make changes to the file and resave, the Updated Date field exports as dd/mm/yyyy, which confuses the Link Library import process.

    LibreOffice and OpenOffice and the TextMate text editor on my Mac preserve the format of the Updated Date field.

    (I should have remembered that I had a problem before with Excel messing up the format of dates in a csv file.)

    Thank you for your help. If I go ahead and put Link Library into production I will certainly consider making a donation.

    Plugin Author Yannick Lefebvre

    (@jackdewey)

    Glad to hear that was all it was. Let me know if you run into any other issues as you experiment with the plugin.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Date updated bug on import?’ is closed to new replies.