本文整理汇总了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);
}
}