fix: try to fix the timezone issue (#229)

This commit is contained in:
leo 2024-07-02 12:30:12 +08:00
parent 4ef0f1180f
commit 57a2144777
No known key found for this signature in database
4 changed files with 8 additions and 14 deletions

View file

@ -4,13 +4,11 @@ namespace SourceGit.Models
{
public class Stash
{
private static readonly DateTime UTC_START = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc).ToLocalTime();
public string Name { get; set; } = "";
public string SHA { get; set; } = "";
public ulong Time { get; set; } = 0;
public string Message { get; set; } = "";
public string TimeStr => UTC_START.AddSeconds(Time).ToString("yyyy/MM/dd HH:mm:ss");
public string TimeStr => DateTime.UnixEpoch.AddSeconds(Time).ToLocalTime().ToString("yyyy/MM/dd HH:mm:ss");
}
}