Skip to content

Commit

Permalink
Make the output and build reproducible
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastic committed Jul 30, 2016
1 parent c5fa9a4 commit 010ff0a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pysal/core/IOHandlers/pyDbfIO.py
Expand Up @@ -4,6 +4,8 @@
import itertools
from warnings import warn
import pysal
import os
import time

__author__ = "Charles R Schmidt <schmidtc@gmail.com>"
__all__ = ['DBF']
Expand Down Expand Up @@ -272,7 +274,12 @@ def _writeHeader(self):
POS = self.f.tell()
self.f.seek(0)
ver = 3
now = datetime.datetime.now()
if 'SOURCE_DATE_EPOCH' in os.environ:
now = datetime.datetime.utcfromtimestamp(
int(os.environ.get('SOURCE_DATE_EPOCH', time.time())),
)
else:
now = datetime.datetime.now()
yr, mon, day = now.year - 1900, now.month, now.day
numrec = self.numrec
numfields = len(self.header)
Expand Down

0 comments on commit 010ff0a

Please sign in to comment.