Implement ISO8601 style dates for backup filenames

This partially implements ISO8601 + RFC3389 dates for backup filenames.
As noted in the changelog, this was a sponsor request, and also, it's
impossible to put the `:` literal in most files in most filesystems. So
as a result, this is technically not compliant with ISO8601 or RFC3389
but it is closer.

Also, wait, I don't even know because I don't have enough money to buy
ISO8601 so we'll just assume this is compliant. Job = done.
This commit is contained in:
Lucas Nicodemus 2021-06-01 23:23:49 -07:00
parent 89555beb73
commit 5b6e31677e
2 changed files with 2 additions and 1 deletions

View file

@ -62,7 +62,7 @@ namespace TShockAPI
string worldname = Main.worldPathName;
string name = Path.GetFileName(worldname);
Main.ActiveWorldFileData._path = Path.Combine(BackupPath, string.Format("{0}.{1:dd.MM.yy-HH.mm.ss}.bak", name, DateTime.UtcNow));
Main.ActiveWorldFileData._path = Path.Combine(BackupPath, string.Format("{0}.{1:yyyy-MM-ddTHH.mm.ssZ}.bak", name, DateTime.UtcNow));
string worldpath = Path.GetDirectoryName(Main.worldPathName);
if (worldpath != null && !Directory.Exists(worldpath))