Ejemplo n.º 1
0
        public void TestDocumentationComments()
        {
            long unixEpochDate = 1095774611000;      // javadoc appears to be wrong - this is actually what changes the GMT time as below
            long ticks         = 632313714110000000; // 2004-09-21 13:50:11

            Assert.AreEqual(ticks, DateTools.UnixTimeMillisecondsToTicks(unixEpochDate));

            long ticksOut = DateTools.Round(ticks, DateResolution.MONTH, NumericRepresentation.TICKS, NumericRepresentation.TICKS);
            long expected = 1093996800000; // javadoc appears to be wrong - this is actually what the above is converted to
            long actual   = DateTools.TicksToUnixTimeMilliseconds(ticksOut);

            Assert.AreEqual(expected, actual);

            long unixEpochDateOut = DateTools.Round(unixEpochDate, DateResolution.MONTH, NumericRepresentation.UNIX_TIME_MILLISECONDS, NumericRepresentation.UNIX_TIME_MILLISECONDS);

            Assert.AreEqual(expected, unixEpochDateOut);
        }