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

Even Rouault even.rouault at spatialys.com
Fri Jun 17 08:29:07 PDT 2022


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
> 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/20220617/9e650b5c/attachment-0001.htm>


More information about the gdal-dev mailing list