Created
December 5, 2021 09:38
-
-
Save raffaem/80c328ff9bc3cc811d8604834684f3e1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import sys | |
import re | |
with open(sys.argv[1], "r", encoding="utf8") as fh: | |
data = fh.read() | |
s = re.search(r"^(DTSTART:\d{8}T\d{6})$", data, re.MULTILINE).group(1) | |
data = data.replace(s, s+"Z") | |
s = re.search(r"^(DTEND:\d{8}T\d{6})$", data, re.MULTILINE).group(1) | |
data = data.replace(s, s+"Z") | |
with open(sys.argv[1], "w", encoding="utf8") as fh: | |
fh.write(data) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment