With .NET Core the UnixEpoch field was introduced to DateTime and DateTimeOffset types. Using this field
clearly states that the intention is to use the beginning of the Unix epoch.
You should not use the DateTime or DateTimeOffset constructors to set the time to the 1st of January 1970 to represent
the beginning of the Unix epoch. Not everyone is familiar with what this particular date is representing and it can be misleading.
To fix this issue, use the UnixEpoch field of DateTime or DateTimeOffset instead of the constructor.
void GetEpochTime()
{
var epochTime = new DateTime(1970, 1, 1);
}
void GetEpochTime()
{
var epochTime = DateTime.UnixEpoch;
}