[Gdal-dev] OGR Date Support

Frank Warmerdam warmerdam at pobox.com
Tue Feb 14 23:33:27 EST 2006


Folks,

I have committed preliminary date support for OGR.  This includes a new
core date type (OFTDate), and would be more accurately called "date time"
support.

The OGRField union now includes another struct option that looks like:

     struct {
         GInt16  Year;
         GByte   Month;
         GByte   Day;
         GByte   Hour;
         GByte   Minute;
         GByte   Second;
         GByte   TZFlag; /* 0=unknown, 1=localtime(ambiguous),
                            100=GMT, 104=GMT+1, 80=GMT-5, etc */
     } Date;

The TZFlag is a funky mechanism to incorporate timezones by offset from
GMT (in 15 minute increments).  But if you just leave TZFlag 0 the timezone
is unknown which I suspect will often be the case.

Note there is no sub-second precision.  My hope is that this isn't too
important in the OGR context.

So far only the PostgreSQL and Shapefile (dbf) drivers have been
updated with date support.  I plan to extend it to MySQL this week.
Over time it will be added in a few more drivers with native date types.

Let me know if anyone runs into problems with the builds that might
be related.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent




More information about the Gdal-dev mailing list