diff --git a/TwitchDownloaderCLI/Modes/Arguments/ChatDownloadArgs.cs b/TwitchDownloaderCLI/Modes/Arguments/ChatDownloadArgs.cs index b41f3109..02f2f27f 100644 --- a/TwitchDownloaderCLI/Modes/Arguments/ChatDownloadArgs.cs +++ b/TwitchDownloaderCLI/Modes/Arguments/ChatDownloadArgs.cs @@ -34,7 +34,7 @@ public class ChatDownloadArgs [Option("stv", Default = true, HelpText = "Enable 7TV embedding in chat download. Requires -E / --embed-images!")] public bool? StvEmotes { get; set; } - [Option("timestamp-format", Default = TimestampFormat.Relative, HelpText = "Sets the timestamp format for .txt chat logs. Valid values are: Utc, Relative, and None")] + [Option("timestamp-format", Default = TimestampFormat.Relative, HelpText = "Sets the timestamp format for .txt chat logs. Valid values are: Utc, UtcFull, Relative, and None")] public TimestampFormat TimeFormat { get; set; } [Option("chat-connections", Default = 4, HelpText = "Number of downloading connections for chat")] diff --git a/TwitchDownloaderCLI/README.md b/TwitchDownloaderCLI/README.md index 563f3c99..07dd179a 100644 --- a/TwitchDownloaderCLI/README.md +++ b/TwitchDownloaderCLI/README.md @@ -96,7 +96,7 @@ Time in seconds to crop ending. For example if I had a 10 second stream but only (Default: `true`) 7TV emote embedding. Requires `-E / --embed-images`. **--timestamp-format** -(Default: `Relative`) Sets the timestamp format for .txt chat logs. Valid values are: `Utc`, `Relative`, and `None`. +(Default: `Relative`) Sets the timestamp format for .txt chat logs. Valid values are: `Utc`, `UtcFull`, `Relative`, and `None`. **--chat-connections** (Default: `4`) The number of parallel downloads for chat. diff --git a/TwitchDownloaderCore/Chat/ChatText.cs b/TwitchDownloaderCore/Chat/ChatText.cs index 7aa1911b..2c686c22 100644 --- a/TwitchDownloaderCore/Chat/ChatText.cs +++ b/TwitchDownloaderCore/Chat/ChatText.cs @@ -28,7 +28,12 @@ public static async Task SerializeAsync(string filePath, ChatRoot chatRoot, Time string message = comment.message.body; if (timeFormat == TimestampFormat.Utc) { - string timestamp = comment.created_at.ToString("u").Replace("Z", " UTC"); + var timestamp = comment.created_at.ToString("yyyy'-'MM'-'dd HH':'mm':'ss 'UTC'");; + await sw.WriteLineAsync($"[{timestamp}] {username}: {message}"); + } + else if (timeFormat == TimestampFormat.UtcFull) + { + var timestamp = comment.created_at.ToString("yyyy'-'MM'-'dd HH':'mm':'ss.fff 'UTC'");; await sw.WriteLineAsync($"[{timestamp}] {username}: {message}"); } else if (timeFormat == TimestampFormat.Relative) diff --git a/TwitchDownloaderCore/Chat/TimestampFormat.cs b/TwitchDownloaderCore/Chat/TimestampFormat.cs index e486371a..5386f812 100644 --- a/TwitchDownloaderCore/Chat/TimestampFormat.cs +++ b/TwitchDownloaderCore/Chat/TimestampFormat.cs @@ -4,6 +4,7 @@ public enum TimestampFormat { Utc, Relative, - None + None, + UtcFull } }