本文整理汇总了C#中System.Globalization.JulianCalendar类的典型用法代码示例。如果您正苦于以下问题:C# JulianCalendar类的具体用法?C# JulianCalendar怎么用?C# JulianCalendar使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JulianCalendar类属于System.Globalization命名空间,在下文中一共展示了JulianCalendar类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: new JulianCalendar()
//引入命名空间
using System;
class MainClass {
public static void DisplayDateTime(string name, DateTime myDateTime) {
Console.WriteLine(name + " = " + myDateTime);
Console.WriteLine(name + ".Year = " + myDateTime.Year);
Console.WriteLine(name + ".Month = " + myDateTime.Month);
Console.WriteLine(name + ".Day = " + myDateTime.Day);
Console.WriteLine(name + ".Hour = " + myDateTime.Hour);
Console.WriteLine(name + ".Minute = " + myDateTime.Minute);
Console.WriteLine(name + ".Second = " + myDateTime.Second);
Console.WriteLine(name + ".Millisecond = " + myDateTime.Millisecond);
Console.WriteLine(name + ".Ticks = " + myDateTime.Ticks);
}
public static void Main()
{
int year = 2002;
int month = 12;
int day = 25;
int hour = 23;
int minute = 30;
int second = 12;
int millisecond = 5;
DateTime myDateTime = new DateTime(year, month, day, hour, minute, second, millisecond);
DisplayDateTime("myDateTime", myDateTime);
System.Globalization.JulianCalendar myCalendar = new System.Globalization.JulianCalendar();
DateTime myDateTime3 = new DateTime(year, month, day, myCalendar);
DisplayDateTime("myDateTime3", myDateTime3);
}
}
开发者ID:C#程序员,项目名称:System.Globalization,代码行数:36,代码来源:JulianCalendar
注:本文中的System.Globalization.JulianCalendar类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论