Skip to content

Instantly share code, notes, and snippets.

@raffaem
Created December 5, 2021 09:38
Embed
What would you like to do?
#!/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