本文整理汇总了C#中Time.Projection方法的典型用法代码示例。如果您正苦于以下问题:C# Time.Projection方法的具体用法?C# Time.Projection怎么用?C# Time.Projection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Time
的用法示例。
在下文中一共展示了Time.Projection方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TimeZoneGmtIsGmt
public void TimeZoneGmtIsGmt()
{
var timezone = Right.AtGmt;
var time = new Time (1409473135, TimeContext.Default);
var gregorian = time.Projection<Gregorian> (timezone);
Assert.AreEqual ("Etc/GMT", timezone.Name);
Assert.AreEqual (TimeZoneInfo.Utc, timezone.ToTimeZoneInfo ());
Assert.AreEqual ("31.08.2014 08:18:55", gregorian.ToString ("dd.MM.yyyy hh:mm:ss"));
}
示例2: TimeZoneAtOsloIsAtOslo
public void TimeZoneAtOsloIsAtOslo()
{
var timezone = Right.At ("Europe/Oslo");
var time = new Time (1409473135, TimeContext.Default);
var gregorian = time.Projection<Gregorian> (timezone);
var zoneinfo = timezone.ToTimeZoneInfo ();
TimeZoneInfo target;
try {
target = TimeZoneInfo.FindSystemTimeZoneById ("W. Europe Standard Time");
} catch {
target = TimeZoneInfo.FindSystemTimeZoneById ("Europe/Oslo");
}
Assert.AreEqual ("Europe/Oslo", timezone.Name);
Assert.AreEqual (target, zoneinfo);
Assert.AreEqual ("31.08.2014 10:18:55", gregorian.ToString ("dd.MM.yyyy hh:mm:ss"));
}
示例3: GregorianPrintsNicely
public void GregorianPrintsNicely()
{
var time = new Time (205956690, TimeContext.Default);
string result = time.Projection<Gregorian> ().ToString ("yyyy MM dd");
Assert.AreEqual ("1976 07 11", result.ToString ());
}
示例4: GregorianMonthIsRight
public void GregorianMonthIsRight()
{
var time = new Time (205956690, TimeContext.Default);
Assert.AreEqual (Month.July, time.Projection<Gregorian> ().Month);
}
示例5: GregorianMinuteIsRight
public void GregorianMinuteIsRight()
{
var time = new Time (205956690, TimeContext.Default);
Assert.AreEqual (11, time.Projection<Gregorian> ().Minute);
}
示例6: GregorianHourIsRight
public void GregorianHourIsRight()
{
var time = new Time (205956690, TimeContext.Default);
Assert.AreEqual (18, time.Projection<Gregorian> ().Hour);
}
示例7: GregorianDayOfWeekIsRight
public void GregorianDayOfWeekIsRight()
{
var time = new Time (205956690, TimeContext.Default);
Assert.AreEqual (DayOfWeek.Sunday, time.Projection<Gregorian> ().DayOfWeek);
}
示例8: GregorianSecondIsRight
public void GregorianSecondIsRight()
{
var time = new Time (205956690, TimeContext.Default);
Assert.AreEqual (30, time.Projection<Gregorian> ().Second);
}