I save date from database's timestamp to shapefile date attribute. For example, I took from database [2031,10,31]
and set it to '31.10.2031'
at shapefile using python's shapefile.py
as sh
:
self.sh.field('Exp_date', 'D', 10)
....
valueString = date(*tuple(date_value)).strftime('%d.%m.%Y')
print valueString
>>>31.10.2031
self.records.append(valueString)
... # set other fields
self.sh.record(*self.records)
But when I open the result at ArcGIS 10.1 I see all years converting to 1930-2029 (as system Date&Time settings). So when I open the dbf at shapefile directory, I see the DD.MM.YY-format dates. But at DBF specification 'D' fields are YYYYMMDD format.
Is there a way to save full year at dbf?
'%Y%m%d'
instrftime
). There is no space for delimiters in the 8 character buffer.strftime('%d.%m.%Y')
tostrftime('%Y%m%d')
and date stay clear. Can you write your tip as answer?