title: PythonNET DateTime C# .NET List how to populate it?
body: <p>I can't find any answers out there for PythonNET working with Lists, a package for Python that lets you import .NET DLLs.  For some reason creating a list of DateTime was not working for me.  <strong><em>SOLVED</em></strong>  Here's how to make it work:</p>
  
  <pre><code>import clr
  from pandas import to_datetime, Series
  from System.Collections.Generic import List
  from System import DateTime
  
  Contracts = to_datetime(Series(['9/1/2014','10/1/2014','11/1/2014','12/1/2014','1/1/2015','2/1/2015','3/1/2015','4/1/2015','5/1/2015','6/1/2015','7/1/2015','8/1/2015']))
  DateList = List[DateTime](range(len(Contracts)))
  for i in range(len(Contracts)): DateList.Add(DateTime(Contracts[i].year,Contracts[i].month,Contracts[i].day))
  </code></pre>
  
  <p>(Sorry about the above formatting, I can't get the indent to work in the loop).  To show the contents of the list, you can do this:</p>
  
  <pre><code>print(DateList.get_Item(0))
  9/1/2014 12:00:00 AM
  
  print(DateList.get_Item(11))
  8/1/2015 12:00:00 AM
  </code></pre>