简体   繁体   中英

List of DateTime Array in c#

I am trying to generate a list with set of array's having 2 dates per array.

I googled to find the logic in last two days, i could not figured out it,yet.

can anyone give me some idea and code snippet example.

@shameer: Are you looking for this?

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() } };

(or)in simple understanding

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);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM