本文整理汇总了C#中TimeInterval.ToTimeStandard方法的典型用法代码示例。如果您正苦于以下问题:C# TimeInterval.ToTimeStandard方法的具体用法?C# TimeInterval.ToTimeStandard怎么用?C# TimeInterval.ToTimeStandard使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TimeInterval
的用法示例。
在下文中一共展示了TimeInterval.ToTimeStandard方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestToTimeStandard
public void TestToTimeStandard()
{
JulianDate start = new JulianDate(2451545.0, TimeStandard.CoordinatedUniversalTime);
JulianDate stop = new JulianDate(2451546.0, TimeStandard.CoordinatedUniversalTime);
TimeInterval interval = new TimeInterval(start, stop);
TimeInterval result = interval.ToTimeStandard(TimeStandard.CoordinatedUniversalTime);
Assert.AreEqual(result.Start.Standard, TimeStandard.CoordinatedUniversalTime);
Assert.AreEqual(result.Stop.Standard, TimeStandard.CoordinatedUniversalTime);
Assert.AreEqual(result.Start.TotalDays, 2451545.0, Constants.Epsilon15);
Assert.AreEqual(result.Stop.TotalDays, 2451546.0, Constants.Epsilon15);
result = interval.ToTimeStandard(TimeStandard.InternationalAtomicTime);
Assert.AreEqual(result.Start.Standard, TimeStandard.InternationalAtomicTime);
Assert.AreEqual(result.Stop.Standard, TimeStandard.InternationalAtomicTime);
Assert.AreNotEqual(result.Start.TotalDays, 2451545.0);
Assert.AreNotEqual(result.Stop.TotalDays, 2451546.0);
TimeInterval empty = new TimeInterval(new JulianDate(2451545.0, TimeStandard.CoordinatedUniversalTime),
new JulianDate(2451545.0, TimeStandard.CoordinatedUniversalTime));
Assert.IsTrue(empty.IsEmpty);
result = empty.ToTimeStandard(TimeStandard.InternationalAtomicTime);
Assert.IsTrue(result.IsEmpty);
}