datetime.datetime.utcnow() is deprecated

This commit is contained in:
tooomm 2025-08-10 12:15:34 +02:00
parent cae671b37f
commit d74a762f35

View File

@ -261,13 +261,13 @@ def open_header(card_xml_file: IO[Any], filename: str) -> None:
card_xml_file.write(
"<cockatrice_carddatabase version='4' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='https://raw.githubusercontent.com/Cockatrice/Cockatrice/master/doc/carddatabase_v4/cards.xsd'>\n"
+ " <!--\n"
+ " Created At: " + datetime.datetime.utcnow().strftime("%a, %b %d %Y, %H:%M:%S") + " (UTC)\n"
+ " Created At: " + datetime.datetime.now(datetime.UTC).strftime("%a, %b %d %Y, %H:%M:%S") + " (UTC)\n"
+ " \n"
+ " THIS FILE IS AUTOMATICALLY GENERATED & ALL EDITS WILL BE OVERRIDDEN.\n"
+ " -->\n"
+ "<info>\n"
+ " <author>Cockatrice/Magic-Spoiler</author>\n"
+ " <createdAt>" + datetime.datetime.utcnow().strftime("%Y-%m-%d %H:%M:%S") + " (UTC)</createdAt>\n"
+ " <createdAt>" + datetime.datetime.now(datetime.UTC).strftime("%Y-%m-%d %H:%M:%S") + " (UTC)</createdAt>\n"
+ " <sourceUrl>https://raw.githubusercontent.com/Cockatrice/Magic-Spoiler/files/" + filename + "</sourceUrl>\n"
+ " <sourceVersion></sourceVersion>\n"
+ "</info>\n"