本文整理汇总了C#中DateTimeOffset.BeginningOfDay方法的典型用法代码示例。如果您正苦于以下问题:C# DateTimeOffset.BeginningOfDay方法的具体用法?C# DateTimeOffset.BeginningOfDay怎么用?C# DateTimeOffset.BeginningOfDay使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DateTimeOffset
的用法示例。
在下文中一共展示了DateTimeOffset.BeginningOfDay方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LastDayOfQuarter_Q4_SetsTheDayToLastDayOfQuarter
public void LastDayOfQuarter_Q4_SetsTheDayToLastDayOfQuarter()
{
var expected = new DateTimeOffset(2002, 12, 31, 4, 5, 6, TimeSpan.Zero);
Assert.AreEqual(expected.BeginningOfDay(), new DateTimeOffset(2002, 11, 22, 12, 12, 12, TimeSpan.Zero).LastDayOfQuarter().BeginningOfDay());
}
示例2: FirstDayOfQuarter_Q4_SetsDayToFirstDay
public void FirstDayOfQuarter_Q4_SetsDayToFirstDay()
{
var expected = new DateTimeOffset(2002, 10, 1, 7, 8, 9, TimeSpan.Zero);
Assert.AreEqual(expected.BeginningOfDay(), new DateTimeOffset(2002, 11, 22, 12, 12, 12, TimeSpan.Zero).FirstDayOfQuarter().BeginningOfDay());
}
示例3: NextQuarter_LastDay_SetsTheDayToLastDayOfQuarter
public void NextQuarter_LastDay_SetsTheDayToLastDayOfQuarter()
{
var expected = new DateTimeOffset(2002, 6, 30, 3, 5, 6, TimeSpan.Zero);
Assert.AreEqual(expected.BeginningOfDay(), 1.Quarters().From(new DateTimeOffset(2002, 1, 10, 4, 5, 6, TimeSpan.Zero).LastDayOfQuarter().BeginningOfDay()));
}
示例4: FirstDayOfQuarter_SetsTheDayToOne
public void FirstDayOfQuarter_SetsTheDayToOne()
{
var expected = new DateTimeOffset(2002, 1, 1, 6, 3, 0, TimeSpan.Zero);
Assert.AreEqual(expected.BeginningOfDay(), new DateTimeOffset(2002, 3, 22, 12, 12, 12, TimeSpan.Zero).FirstDayOfQuarter().BeginningOfDay());
}
示例5: PreviousQuarter_LastDay_SetsTheDayToLastDayOfQuarter
public void PreviousQuarter_LastDay_SetsTheDayToLastDayOfQuarter()
{
var expected = new DateTimeOffset(2001, 12, 31, 3, 5, 6, TimeSpan.Zero);
Assert.AreEqual(expected.BeginningOfDay(), 1.Quarters().Ago(new DateTimeOffset(2002, 1, 10, 4, 5, 6, TimeSpan.Zero).LastDayOfQuarter().BeginningOfDay()));
}