MapInfo Pro

 View Only
  • 1.  Date format dd/MM/yyyy not exporting to SHP from TAB in Universal Translator

    Posted 05-13-2021 06:23
    I have a MapInfo table with a date field, with dates in the format dd/MM/yyyy such as 26/11/1990.  When I translate the file to Shapefile using the Universal Translator, it comes out as yyyy-MM-dd (1990-11-26 instead of 26/11/1990).

    Is there anything I can do about this, as the format dd/MM/yyyy is required by those I'm sending the data to?

    Thanks!
    Jane


    ------------------------------
    Jane Mason
    Biological Records Officer (GIS), Suffolk Biodiversity Information Service, UK
    ------------------------------


  • 2.  RE: Date format dd/MM/yyyy not exporting to SHP from TAB in Universal Translator

    Posted 05-13-2021 08:29

    Hello Jane,

     

    Usually date format issues are national differences (e.g. mm/dd/yyyy in the US and dd/mm/yyyy in the UK), but the "reverse" date format of YYYY-MM-DD is a neutral ISO format for date representation and is really intended for internal computing use. The advantage is that it sorts correctly when stored as a number or string (since year is more important than month, which is in turn more important that day).

     

    FME (on which the Universal Translator is based) handles date fields quite well, so I wonder if your translation is writing a TAB file with the date field as a string, rather than date, type. In the absence of any directive to convert into a particular format, date-to-string may well output this way. If this is the case, I don't know why a date-type field is not being used. Perhaps check that your source SHP is really using date fields and check your output TAB for the same.

     

    I've just tried a SHP -> TAB translation with the UT using some data with multiple date fields and things seem to convert OK. It's therefore a puzzle as to why you're seeing the ISO format. It would be worth finding out if it's actually the data itself or the MapInfo/PC locale settings which result in dates being shown this way.

     

    Regards,

    Warren Vick

     






  • 3.  RE: Date format dd/MM/yyyy not exporting to SHP from TAB in Universal Translator

    Posted 05-13-2021 09:03
    Hi Jane,

    Is it at your end or the client's end that the date is displaying as "yyyy-MM-dd"?  It may be the client's regional settings.

    If you wish to force the date to retain the desired format, you could use a character field type to store the date instead of a date field type.


    ------------------------------
    James Nolet
    Dooley Mitchell & Morrison Pty Ltd
    Mentone, VIC, Australia
    ------------------------------



  • 4.  RE: Date format dd/MM/yyyy not exporting to SHP from TAB in Universal Translator

    Posted 05-13-2021 09:48
    Thank you both, I think I understand now.  It's to do with the software the date field is displayed in.  I'm converting from TAB to SHP - the resulting SHP displays the date field correctly as dd/mm/yyyy in MapInfo, but trying to view it in the client's software produces yyyy-MM-dd.  So they can change their settings to display it as they wish.  

    Thanks for your help,
    Jane


    ------------------------------
    Jane Mason
    Biological Records Officer (GIS), Suffolk Biodiversity Information Service, UK
    ------------------------------