Skip to content

Commit

Permalink
Merge pull request #162 from Xele02/FixTimezone
Browse files Browse the repository at this point in the history
Fix local time
  • Loading branch information
Xele02 authored Dec 9, 2023
2 parents ddaa11b + b04fa97 commit 25f6ade
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Unity/Assets/UMAssets/Scripts/XeSys/Utility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ public static DateTime GetLocalDateTime(long unixTime)
{
//UMO, get real timeline
double diff = (DateTime.Now - DateTime.UtcNow).TotalSeconds;
return TimeZoneInfo.ConvertTimeToUtc(UNIX_EPOCH.AddSeconds(unixTime + diff/* + 32400*/));
return /*TimeZoneInfo.ConvertTimeToUtc(*/UNIX_EPOCH.AddSeconds(unixTime + diff/* + 32400*/)/*)*/;
}

// // RVA: 0x23A90F8 Offset: 0x23A90F8 VA: 0x23A90F8
public static long GetTargetUnixTime(int year, int month, int day, int hour, int minute, int second)
{
DateTime date = new DateTime(year, month, day, hour, minute, second, DateTimeKind.Utc);
return (long)(TimeZoneInfo.ConvertTimeToUtc(date, TimeZoneInfo.Utc) - UNIX_EPOCH).TotalSeconds;
DateTime date = new DateTime(year, month, day, hour, minute, second, DateTimeKind.Local);
return (long)(TimeZoneInfo.ConvertTimeToUtc(date) - UNIX_EPOCH).TotalSeconds;
}

// // RVA: 0x23A9268 Offset: 0x23A9268 VA: 0x23A9268
Expand Down

0 comments on commit 25f6ade

Please sign in to comment.