diff --git a/PKHeX.Core/Saves/Substructures/Gen9/ZA/DonutPocket9a.cs b/PKHeX.Core/Saves/Substructures/Gen9/ZA/DonutPocket9a.cs index a3d12916d..7547509d4 100644 --- a/PKHeX.Core/Saves/Substructures/Gen9/ZA/DonutPocket9a.cs +++ b/PKHeX.Core/Saves/Substructures/Gen9/ZA/DonutPocket9a.cs @@ -92,7 +92,7 @@ private static void ApplyTimestampNow(Donut9a entry, int bias = 0) if (bias != 0) // some fudge factor to differentiate donuts made on the same millisecond now = now.AddMilliseconds(bias); var ticks = (ulong)(now - Donut9a.Epoch).TotalMilliseconds; - entry.MillisecondsSince1900 = ticks; + entry.MillisecondsSince1970 = ticks; entry.DateTime1900.Timestamp = now; } @@ -576,10 +576,10 @@ public static bool TryGetFlavorName(ulong hash, [NotNullWhen(true)] out string? public const int Size = 0x48; public Span Data => Raw.Span; - public static DateTime Epoch => new(1900, 1, 1, 0, 0, 0, DateTimeKind.Local); + public static DateTime Epoch => new(1970, 1, 1, 0, 0, 0, DateTimeKind.Local); /* - 0x00 u64 MillisecondsSince1900 + 0x00 u64 MillisecondsSince1970 0x08 u8 Stars 0x09 u8 LevelBoost @@ -604,9 +604,9 @@ public static bool TryGetFlavorName(ulong hash, [NotNullWhen(true)] out string? */ /// - /// Timestamp the donut was created, in milliseconds since January 1, 1900. + /// Timestamp the donut was created, in milliseconds since January 1, 1970. /// - public ulong MillisecondsSince1900 { get => ReadUInt64LittleEndian(Data); set => WriteUInt64LittleEndian(Data, value); } + public ulong MillisecondsSince1970 { get => ReadUInt64LittleEndian(Data); set => WriteUInt64LittleEndian(Data, value); } public byte Stars { get => Data[0x08]; set => Data[0x08] = value; } public byte LevelBoost { get => Data[0x09]; set => Data[0x09] = value; } @@ -638,7 +638,7 @@ public static bool TryGetFlavorName(ulong hash, [NotNullWhen(true)] out string? /// Alternate date storage format for the donut creation time. /// /// - /// is the source of truth; this value should be kept in sync via . + /// is the source of truth; this value should be kept in sync via . /// public Epoch1900DateTimeValue DateTime1900 => new(Raw[0x20..0x28]); @@ -649,17 +649,17 @@ public static bool TryGetFlavorName(ulong hash, [NotNullWhen(true)] out string? public ulong Reserved { get => ReadUInt64LittleEndian(Data[0x40..]); set => WriteUInt64LittleEndian(Data[0x40..], value); } /// - /// Updates the value based on the stored . + /// Updates the value based on the stored . /// /// - /// The values should always mirror each other, but their storage formats differ. Treat as the main source of truth. + /// The values should always mirror each other, but their storage formats differ. Treat as the main source of truth. /// - public void UpdateDateTime() => DateTime1900.Timestamp = Epoch.AddMilliseconds(MillisecondsSince1900); + public void UpdateDateTime() => DateTime1900.Timestamp = Epoch.AddMilliseconds(MillisecondsSince1970); /// - /// A non-zero indicates that this donut slot is occupied. A zero-value with non-zero flavors/berries is invalid (and causes display glitches in-game). + /// A non-zero indicates that this donut slot is occupied. A zero-value with non-zero flavors/berries is invalid (and causes display glitches in-game). /// - public bool IsEmpty => MillisecondsSince1900 != 0; + public bool IsEmpty => MillisecondsSince1970 != 0; /// /// Count of flavor perks granted by this donut. diff --git a/PKHeX.WinForms/Subforms/Save Editors/Gen9/DonutEditor9a.Designer.cs b/PKHeX.WinForms/Subforms/Save Editors/Gen9/DonutEditor9a.Designer.cs index 979e4bf99..2cec9536b 100644 --- a/PKHeX.WinForms/Subforms/Save Editors/Gen9/DonutEditor9a.Designer.cs +++ b/PKHeX.WinForms/Subforms/Save Editors/Gen9/DonutEditor9a.Designer.cs @@ -681,7 +681,7 @@ private void InitializeComponent() // // CAL_Date // - CAL_Date.CustomFormat = "hh:mm:ss ddd MMMM dd, yyyy"; + CAL_Date.CustomFormat = "ddd MMMM dd, yyyy hh:mm:ss"; CAL_Date.Format = System.Windows.Forms.DateTimePickerFormat.Custom; CAL_Date.Location = new System.Drawing.Point(106, 170); CAL_Date.Margin = new System.Windows.Forms.Padding(0, 0, 0, 1); diff --git a/PKHeX.WinForms/Subforms/Save Editors/Gen9/DonutEditor9a.cs b/PKHeX.WinForms/Subforms/Save Editors/Gen9/DonutEditor9a.cs index f431ffb57..4f08d0392 100644 --- a/PKHeX.WinForms/Subforms/Save Editors/Gen9/DonutEditor9a.cs +++ b/PKHeX.WinForms/Subforms/Save Editors/Gen9/DonutEditor9a.cs @@ -180,7 +180,7 @@ public void LoadDonut(Donut9a donut) CAL_Date.Value = Epoch; } - TB_Milliseconds.Text = donut.MillisecondsSince1900.ToString(); + TB_Milliseconds.Text = donut.MillisecondsSince1970.ToString(); Loading = false; return; @@ -231,7 +231,7 @@ public void SaveDonut() donut.ClearDateTime(); } } - donut.MillisecondsSince1900 = ulong.TryParse(TB_Milliseconds.Text, out var unk) ? unk : 0; + donut.MillisecondsSince1970 = ulong.TryParse(TB_Milliseconds.Text, out var unk) ? unk : 0; } private static void LoadDonutFlavorHash(ComboBox cb, ulong flavorHash)