Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c56dae7

Browse files
author
Alexis Bienvenüe
committed
Use standard date format for PS timestamp
1 parent da55bb6 commit c56dae7

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

lib/matplotlib/backends/backend_ps.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1092,7 +1092,7 @@ def print_figure_impl():
10921092
source_date_epoch = os.getenv("SOURCE_DATE_EPOCH")
10931093
if source_date_epoch:
10941094
source_date = datetime.datetime.utcfromtimestamp(
1095-
int(source_date_epoch) ).strftime("%a %b %e %T %Y")
1095+
int(source_date_epoch) ).strftime("%a %b %d %H:%M:%S %Y")
10961096
else:
10971097
source_date = time.ctime()
10981098
print("%%CreationDate: "+source_date, file=fh)

lib/matplotlib/tests/test_backend_ps.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ def test_source_date_epoch():
183183
# because the produced timestamp comes from ghostscript:
184184
# %%CreationDate: D:20000101000000Z00\'00\', and this could change
185185
# with another ghostscript version.
186-
_test_source_date_epoch("ps", b"%%CreationDate: Sat Jan 1 00:00:00 2000")
186+
_test_source_date_epoch("ps", b"%%CreationDate: Sat Jan 01 00:00:00 2000")
187187

188188

189189
@cleanup

0 commit comments

Comments
 (0)