[gdal-dev] convert to ESRI Shapefile- datetime as a string?

Ashley Mort ashley_c_mort at raytheon.com
Fri Jun 17 20:32:04 PDT 2022


That worked.  Thanks!

Ashley Mort
Sr. Software Engineer
972-638-6317 office
814-571-3039 cell

From: Even Rouault <even.rouault at spatialys.com>
Sent: Friday, June 17, 2022 10:29 AM
To: Ashley Mort <ashley_c_mort at raytheon.com>; gdal-dev at lists.osgeo.org
Subject: [External] Re: [gdal-dev] convert to ESRI Shapefile- datetime as a string?


Ashley,

try adding "-mapFieldType DateTime=String". See https://gdal.org/programs/ogr2ogr.html#cmdoption-ogr2ogr-mapFieldType

You won't get a ISO datetime but the historical format used by OGR: "YYYY/MM/DD HH:MM:SS"

Even
Le 17/06/2022 à 16:51, Ashley Mort via gdal-dev a écrit :
We are using GDAL 3.4.1 to convert GeoJSON to ESRI Shapefile with ogr2ogr.  Our source data has a datetime field with content like “2022-07-09T23:59:59.000000Z” and in the resultant Shapefile it shows up as 7/9/2002.

Is there a way to get the ISO datetime into the Shapefile as a string instead of the truncated date?

Thanks!

Ashley Mort
Sr. Software Engineer
972-638-6317 office
814-571-3039 cell




_______________________________________________

gdal-dev mailing list

gdal-dev at lists.osgeo.org<mailto:gdal-dev at lists.osgeo.org>

https://lists.osgeo.org/mailman/listinfo/gdal-dev

--

http://www.spatialys.com

My software is free, but my time generally not.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20220618/bffde10d/attachment.htm>


More information about the gdal-dev mailing list