I am trying to pass DateTime.MaxValue
into a constructor, but for some reason when it is passed, the Ticks
property changes from 315537897599999999
to 3155378975990000000
, making it difficult to use for comparison.
DateTime dt = DateTime.MaxValue; //here it is 315537897599999999
OfferSetting setting = new OfferSetting(settingCode
, (Equals(row["AccountId"], "")) ? null : row["AccountId"].ToString()
, (Equals(row["Arguments"], "")) ? null : row["Arguments"].ToString()
, (Equals(row["StartDate"], "") || Equals(row["StartDate"], DBNull.Value)) ? DateTime.MinValue : Convert.ToDateTime(row["StartDate"])
, (Equals(row["EndDate"], "") || Equals(row["StartDate"], DBNull.Value)) ? dt : Convert.ToDateTime(row["EndDate"]));
Once in the constructor for OfferSetting
, it changes to 3155378975990000000
:
public OfferSetting(SettingCode settingCode, string accountId, string arguments, DateTime startDate, DateTime endDate)
: base(MoeState.New)
{
this.Id = "-1";
this.OfferSettingId = "-1";
this.SettingCode = settingCode;
this.AccountId = accountId;
this.Arguments = arguments;
this.StartDate = startDate;
this.EndDate = endDate; //here it is 3155378975990000000
}
Any ideas?