Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ public DateTime TimeGenerated
{
get
{
return beginningOfTime.AddSeconds(IntFrom(dataBuf, bufOffset + FieldOffsets.TIMEGENERATED)).ToLocalTime();
return DateTime.UnixEpoch.AddSeconds(IntFrom(dataBuf, bufOffset + FieldOffsets.TIMEGENERATED)).ToLocalTime();
}
}

Expand All @@ -258,7 +258,7 @@ public DateTime TimeWritten
{
get
{
return beginningOfTime.AddSeconds(IntFrom(dataBuf, bufOffset + FieldOffsets.TIMEWRITTEN)).ToLocalTime();
return DateTime.UnixEpoch.AddSeconds(IntFrom(dataBuf, bufOffset + FieldOffsets.TIMEWRITTEN)).ToLocalTime();
}
}

Expand Down Expand Up @@ -475,7 +475,5 @@ private static class FieldOffsets
internal const int DATAOFFSET = 52;
internal const int RAWDATA = 56;
}

private static readonly DateTime beginningOfTime = new DateTime(1970, 1, 1, 0, 0, 0);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public static Func<IEnumerable<Blob>, BlobContentId> GetTimeBasedProvider()
// In the PE File Header this is a "Time/Date Stamp" whose description is "Time and date
// the file was created in seconds since January 1st 1970 00:00:00 or 0"
// However, when we want to make it deterministic we fill it in (later) with bits from the hash of the full PE file.
uint timestamp = (uint)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds;
uint timestamp = (uint)DateTimeOffset.UtcNow.ToUnixTimeSeconds();
return content => new BlobContentId(Guid.NewGuid(), timestamp);
}

Expand Down
Loading