|
8 | 8 | import six |
9 | 9 | from six.moves import StringIO |
10 | 10 |
|
11 | | -import glob, math, os, shutil, sys, time |
| 11 | +import glob, math, os, shutil, sys, time, datetime |
12 | 12 | def _fn_name(): return sys._getframe(1).f_code.co_name |
13 | 13 | import io |
14 | 14 |
|
@@ -1091,7 +1091,8 @@ def print_figure_impl(): |
1091 | 1091 | # See https://reproducible-builds.org/specs/source-date-epoch/ |
1092 | 1092 | source_date_epoch = os.getenv("SOURCE_DATE_EPOCH") |
1093 | 1093 | if source_date_epoch: |
1094 | | - source_date = time.asctime(time.gmtime(int(source_date_epoch))) |
| 1094 | + source_date = datetime.datetime.utcfromtimestamp( |
| 1095 | + int(source_date_epoch) ).strftime("%a %b %e %T %Y") |
1095 | 1096 | else: |
1096 | 1097 | source_date = time.ctime() |
1097 | 1098 | print("%%CreationDate: "+source_date, file=fh) |
@@ -1281,7 +1282,8 @@ def write(self, *kl, **kwargs): |
1281 | 1282 | # See https://reproducible-builds.org/specs/source-date-epoch/ |
1282 | 1283 | source_date_epoch = os.getenv("SOURCE_DATE_EPOCH") |
1283 | 1284 | if source_date_epoch: |
1284 | | - source_date = time.asctime(time.gmtime(int(source_date_epoch))) |
| 1285 | + source_date = datetime.datetime.utcfromtimestamp( |
| 1286 | + int(source_date_epoch) ).strftime("%a %b %e %T %Y") |
1285 | 1287 | else: |
1286 | 1288 | source_date = time.ctime() |
1287 | 1289 | print("%%CreationDate: "+source_date, file=fh) |
|
0 commit comments