[gdal-dev] New config option for date/time output

Joaquim Luis jluis at ualg.pt
Tue Mar 15 05:08:03 PDT 2016


GMT uses "yyy-mm-ddT[hh:mm:ss] (Gregorian) or yyyy-Www-ddT[hh:mm:ss] (ISO)"

http://gmt.soest.hawaii.edu/doc/latest/gmt.conf.html#calendar-time-parameters

It would be nice to use the same.

Joaquim

> Folks,
>
> The OGRFeature::GetFieldAsString returns date/time fields formatted in  
> non-standard way. For example date is output as "year/month/day" as more  
> usual "year-month-day". This causes problems in many programs.
>
> I suggest adding a new config option OGR_DATE_FORMAT, which, if set,  
> would make the method return date/time formatted according to it. I  
> suggest that we use the strftime and its format argument as the target  
> for the new option.
>
> The implementation is complicated a bit when milliseconds and timezones  
> are involved since they are not included in the struct tm used by  
> strftime. I suggest that we assume seconds are formatted as :\d\d in the  
> format and simply add milliseconds (as .\d\d\d) and timezone (as  
> [+-]\d\d(:\d\d)), if they exists, after the second.
>
> Do you think this needs a RFC?
>
> I'm willing to implement the changes.
>
> Ari
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev


More information about the gdal-dev mailing list