build: use date.py instead of date

MacOS (and others) "date" command don't support all the options that GNU
date has. So don't depend on that, add a small python program for this.
This commit is contained in:
Dirk-Jan C. Binnema
2023-10-14 16:22:31 +03:00
parent 967b724e75
commit d8c224ae8e
3 changed files with 17 additions and 9 deletions

9
build-aux/date.py Executable file
View File

@ -0,0 +1,9 @@
#!/bin/env python
#The MacOS 'date' is not quite up to GNU standards
import sys
from datetime import datetime
date=datetime.strptime(sys.argv[1],'%Y-%m-%d')
print(date.strftime(sys.argv[2]))
#
# ./date.py 2023-10-14 "The year-month is %y %m"
#