[英]List of DateTime Array in c#
我正在嘗試生成一個列表,其中包含一組數組,每個數組有 2 個日期。
我在過去兩天用谷歌搜索找到邏輯,但我無法弄清楚。
誰能給我一些想法和代碼片段示例。
@shameer:你在找這個嗎?
List<DateTime[]> list = new List<DateTime[]>() { new[] { DateTime.Now, DateTime.Now }, new[] { DateTime.Today, DateTime.UtcNow } };
List<string[]> list = new List<string[]>() { new[] { "3 / 24 / 2017 2:09:30 AM", "3 / 25 / 2017 2:09:30 AM" }, new[] { DateTime.Now.ToString(), DateTime.UtcNow.ToString() } };
(或)簡單理解
List<DateTime[]> list = new List<DateTime[]>();
DateTime[] array1 = new[] { DateTime.Now, DateTime.Now };
DateTime[] array2 = new[] { DateTime.Today, DateTime.UtcNow };
list.Add(array1);
list.Add(array2);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.