public void DateTimeRounding() { DateTime input = new DateTime(2000, 1, 1, 10, 11, 12, 13); DateTime expected = new DateTime(2000, 1, 1, 10, 11, 12, 10); Assert.AreEqual(expected, AbstractDateTimeType.Round(input, d.TimestampResolutionInTicks)); }
protected virtual DateTime GetTestDate(DateTimeKind kind) { return(AbstractDateTimeType.Round( kind == DateTimeKind.Utc ? DateTime.UtcNow : DateTime.SpecifyKind(DateTime.Now, kind), DateAccuracyInTicks) // Take another date than now for checking the value do not get overridden by seeding. .AddDays(1)); }
protected DateTime RoundForDialect(DateTime value) { return(AbstractDateTimeType.Round(value, Dialect.TimestampResolutionInTicks)); }
public object Read(AbstractDateTimeType dateTimeType) => TypeConverter.DateTimeEpochStart.AddSeconds(reader.ReadUInt32());