本文整理匯總了C#中System.JsDate.GetUtcFullYear方法的典型用法代碼示例。如果您正苦於以下問題:C# JsDate.GetUtcFullYear方法的具體用法?C# JsDate.GetUtcFullYear怎麽用?C# JsDate.GetUtcFullYear使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.JsDate
的用法示例。
在下文中一共展示了JsDate.GetUtcFullYear方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: SetUtcFullYearWithThreeParametersWorks
public void SetUtcFullYearWithThreeParametersWorks() {
var dt = new JsDate(JsDate.Utc(2000, 0, 1));
dt.SetUtcFullYear(2021, 7, 13);
Assert.AreEqual(dt.GetUtcFullYear(), 2021);
Assert.AreEqual(dt.GetUtcMonth(), 7);
Assert.AreEqual(dt.GetUtcDate(), 13);
}
示例2: SetUtcFullYearWithOneParameterWorks
public void SetUtcFullYearWithOneParameterWorks() {
var dt = new JsDate(JsDate.Utc(2000, 0, 1));
dt.SetUtcFullYear(2021);
Assert.AreEqual(dt.GetUtcFullYear(), 2021);
}
示例3: GetUtcFullYearWorks
public void GetUtcFullYearWorks() {
var dt = new JsDate(JsDate.Utc(2011, 7, 12, 13, 42, 56, 345));
Assert.AreEqual(dt.GetUtcFullYear(), 2011);
}
示例4: AssertDateUtc
private void AssertDateUtc(JsDate dt, int year, int month, int day, int hours, int minutes, int seconds, int milliseconds) {
Assert.AreEqual(dt.GetUtcFullYear(), year);
Assert.AreEqual(dt.GetUtcMonth(), month);
Assert.AreEqual(dt.GetUtcDate(), day);
Assert.AreEqual(dt.GetUtcHours(), hours);
Assert.AreEqual(dt.GetUtcMinutes(), minutes);
Assert.AreEqual(dt.GetUtcSeconds(), seconds);
Assert.AreEqual(dt.GetUtcMilliseconds(), milliseconds);
}
示例5: ToUniversalWorks
public void ToUniversalWorks() {
var dt = new JsDate(2011, 7, 12, 13, 42, 56, 345);
var utc = dt.ToUniversalTime();
Assert.AreEqual(dt.GetUtcFullYear(), utc.GetFullYear());
Assert.AreEqual(dt.GetUtcMonth(), utc.GetMonth());
Assert.AreEqual(dt.GetUtcDate(), utc.GetDate());
Assert.AreEqual(dt.GetUtcHours(), utc.GetHours());
Assert.AreEqual(dt.GetUtcMinutes(), utc.GetMinutes());
Assert.AreEqual(dt.GetUtcSeconds(), utc.GetSeconds());
Assert.AreEqual(dt.GetUtcMilliseconds(), utc.GetMilliseconds());
}