Opened 12 years ago

Closed 8 years ago

#3989 closed defect (duplicate)

DBFHeader "Date of Last Update" not correct

Reported by: michalis Owned by: warmerdam
Priority: normal Milestone:
Component: OGR_SF Version: svn-trunk
Severity: trivial Keywords: dbf, dbfheader, date


The following corrections are all part of the dbfopen.c source file, under ogr/ogrsf_frmts/shape/

DBF Header files define a "date of last update" in position 1-3. This is not currently handled correctly, as it inserts a dummy date (07/26/95) on all calls to write a new header (function DBFWriteHeader). The attached file utilizes time.h to retrieve a time_h struct to grab the current date from the system using gmtime_r().

Similarly, when updating headers, the "date of last update" header part is not handled (DBFUpdateHeader). As with the previous correction, a time_h struct initialized through gmtime_r() is used to insert the correct date in the header.

For information about the date of last update in the header, please see

Attachments (1)

dbfopen.c (66.1 KB ) - added by michalis 12 years ago.
Updated dbfopen.c that uses time.h to correctly set dates in DBF headers.

Download all attachments as: .zip

Change History (4)

by michalis, 12 years ago

Attachment: dbfopen.c added

Updated dbfopen.c that uses time.h to correctly set dates in DBF headers.

comment:1 by Even Rouault, 12 years ago

Similar ticket opened as #3919

in reply to:  1 comment:2 by michalis, 12 years ago

Replying to rouault:

Similar ticket opened as #3919

My mistake, I missed that when I was searching for tickets with the term DBF in them.

comment:3 by Jukka Rahkonen, 8 years ago

Resolution: duplicate
Status: newclosed

Duplicate of #3919. However, this ticket may have a better patch.

Note: See TracTickets for help on using tickets.