本文整理汇总了C#中LocalInstant.Minus方法的典型用法代码示例。如果您正苦于以下问题:C# LocalInstant.Minus方法的具体用法?C# LocalInstant.Minus怎么用?C# LocalInstant.Minus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LocalInstant
的用法示例。
在下文中一共展示了LocalInstant.Minus方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MinusOffset_Zero_IsNeutralElement
public void MinusOffset_Zero_IsNeutralElement()
{
Instant sampleInstant = new Instant(1, 23456L);
LocalInstant sampleLocalInstant = new LocalInstant(1, 23456L);
Assert.AreEqual(sampleInstant, sampleLocalInstant.Minus(Offset.Zero));
Assert.AreEqual(sampleInstant, sampleLocalInstant.MinusZeroOffset());
}
示例2: GetIntervalAfterGap
private ZoneInterval GetIntervalAfterGap(LocalInstant localInstant)
{
Instant guess = new Instant(localInstant.Ticks);
ZoneInterval guessInterval = GetZoneInterval(guess);
// If the local interval occurs before the zone interval we're looking at starts,
// it's the one we're looking for. Otherwise, we need to find the next interval.
if (localInstant.Minus(guessInterval.Offset) < guessInterval.Start)
{
return guessInterval;
}
else
{
return GetZoneInterval(guessInterval.End);
}
}
示例3: GetIntervalBeforeGap
private ZoneInterval GetIntervalBeforeGap(LocalInstant localInstant)
{
Instant guess = new Instant(localInstant.Ticks);
ZoneInterval guessInterval = GetZoneInterval(guess);
// If the local interval occurs before the zone interval we're looking at start,
// we need to find the earlier one; otherwise this interval must come after the gap, and
// it's therefore the one we want.
if (localInstant.Minus(guessInterval.Offset) < guessInterval.Start)
{
return GetZoneInterval(guessInterval.Start - Duration.One);
}
else
{
return guessInterval;
}
}