feature: allows to change DateTime format (#755)

This commit is contained in:
leo 2024-12-30 17:19:55 +08:00
parent dc649e6142
commit c058b4744b
No known key found for this signature in database
12 changed files with 118 additions and 37 deletions

View file

@ -428,7 +428,7 @@ namespace SourceGit.Views
var timestamp = UseAuthorTime ? commit.AuthorTime : commit.CommitterTime;
if (ShowAsDateTime)
return DateTime.UnixEpoch.AddSeconds(timestamp).ToLocalTime().ToString("yyyy/MM/dd HH:mm:ss");
return DateTime.UnixEpoch.AddSeconds(timestamp).ToLocalTime().ToString(Models.DateTimeFormat.Actived.DateTime);
var now = DateTime.Now;
var localTime = DateTime.UnixEpoch.AddSeconds(timestamp).ToLocalTime();