mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2025-05-29 05:55:21 -04:00
Add "unix" and "unixms" options for date format (#405)
This commit is contained in:
parent
c4007d4a80
commit
ddb4856516
1 changed files with 6 additions and 1 deletions
|
@ -37,7 +37,12 @@ namespace DiscordChatExporter.Domain.Exporting
|
|||
_mediaDownloader = new MediaDownloader(request.OutputMediaDirPath);
|
||||
}
|
||||
|
||||
public string FormatDate(DateTimeOffset date) => date.ToLocalString(Request.DateFormat);
|
||||
public string FormatDate(DateTimeOffset date) => Request.DateFormat switch
|
||||
{
|
||||
"unix" => date.ToUnixTimeSeconds().ToString(),
|
||||
"unixms" => date.ToUnixTimeMilliseconds().ToString(),
|
||||
var df => date.ToLocalString(df),
|
||||
};
|
||||
|
||||
public Member? TryGetMember(string id) =>
|
||||
Members.FirstOrDefault(m => m.Id == id);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue