当前位置: 首页>>代码示例>>C#>>正文


C# Time.Projection方法代码示例

本文整理汇总了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"));
 }
开发者ID:jarlrasm,项目名称:JarlTime,代码行数:9,代码来源:TimeZoneTest.cs

示例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"));
 }
开发者ID:jarlrasm,项目名称:JarlTime,代码行数:16,代码来源:TimeZoneTest.cs

示例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 ());
 }
开发者ID:jarlrasm,项目名称:JarlTime,代码行数:6,代码来源:TimeTest.cs

示例4: GregorianMonthIsRight

 public void GregorianMonthIsRight()
 {
     var time = new Time (205956690, TimeContext.Default);
     Assert.AreEqual (Month.July, time.Projection<Gregorian> ().Month);
 }
开发者ID:jarlrasm,项目名称:JarlTime,代码行数:5,代码来源:TimeTest.cs

示例5: GregorianMinuteIsRight

 public void GregorianMinuteIsRight()
 {
     var time = new Time (205956690, TimeContext.Default);
     Assert.AreEqual (11, time.Projection<Gregorian> ().Minute);
 }
开发者ID:jarlrasm,项目名称:JarlTime,代码行数:5,代码来源:TimeTest.cs

示例6: GregorianHourIsRight

 public void GregorianHourIsRight()
 {
     var time = new Time (205956690, TimeContext.Default);
     Assert.AreEqual (18, time.Projection<Gregorian> ().Hour);
 }
开发者ID:jarlrasm,项目名称:JarlTime,代码行数:5,代码来源:TimeTest.cs

示例7: GregorianDayOfWeekIsRight

 public void GregorianDayOfWeekIsRight()
 {
     var time = new Time (205956690, TimeContext.Default);
     Assert.AreEqual (DayOfWeek.Sunday, time.Projection<Gregorian> ().DayOfWeek);
 }
开发者ID:jarlrasm,项目名称:JarlTime,代码行数:5,代码来源:TimeTest.cs

示例8: GregorianSecondIsRight

 public void GregorianSecondIsRight()
 {
     var time = new Time (205956690, TimeContext.Default);
     Assert.AreEqual (30, time.Projection<Gregorian> ().Second);
 }
开发者ID:jarlrasm,项目名称:JarlTime,代码行数:5,代码来源:TimeTest.cs


注:本文中的Time.Projection方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。