Skip to content

Commit

Permalink
Correct systemTime zero padding of year field
Browse files Browse the repository at this point in the history
  • Loading branch information
Sparker95 committed Feb 10, 2021
1 parent 1e8b68a commit 7b20059
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/GameManager/SaveGameHeader.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ CLASS("SaveGameHeader", "Storable")

private _saveVersion = parseNumber T_GETV("saveVersion");

// SAVEBREAK patch system time for old headers
if (_saveVersion < 31) then {
private _timeZero = [0,0,0,0,0,0,0];
T_SETV("systemTimeUTC", _timeZero);
};
// SAVEBREAK patch system time for old headers
if (_saveVersion < 31) then {
private _timeZero = [0,0,0,0,0,0,0];
T_SETV("systemTimeUTC", _timeZero);
};
true
ENDMETHOD;

Expand Down
3 changes: 2 additions & 1 deletion src/Misc/fn_systemTimeToISO8601.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ Return value: "2020-11-23T13:37:42.123"
*/

_date = _this;
private _year4 = [_date#0, 4] call misc_fnc_numberToStringZeroPad;
private _ms = [_date#6, 3] call misc_fnc_numberToStringZeroPad; // Zero-pad numbers below 100
_date = _date apply { [_x, 2] call misc_fnc_numberToStringZeroPad }; // Zero-pad numbers below 10
_date params ["_year", "_month", "_day", "_h", "_m", "_s"];
format ["%1-%2-%3T%4:%5:%6.%7", _year, _month, _day, _h, _m, _s, _ms]
format ["%1-%2-%3T%4:%5:%6.%7", _year4, _month, _day, _h, _m, _s, _ms]

0 comments on commit 7b20059

Please sign in to comment.