title: Linq to CSV DateTime format using C#
body: <p>I have a huge CSV file with columns like this. </p>
  
  <p>col1;col2</p>
  
  <p>2013-12-17 15.52.35;1,09</p>
  
  <p>2013-12-17 16.52.35;2,09</p>
  
  <p>2013-12-17 17.52.35;3,09</p>
  
  <p>I am trying to print the first column but it wont due to a different date/time format. However it prints the column in format 2013-12-17 15:52:35. </p>
  
  <pre><code>public class LinqData
  {
      [CsvColumn(FieldIndex = 1)]
      public DateTime col1 { get; set; }
  
      [CsvColumn(FieldIndex = 2)]
      public float col2 { get; set; }
  }
  
  public class LinqToCSV
  {
      public static IEnumerable&lt;LinqData&gt; somefunction()
     {
         var inputFileDescription = new CsvFileDescription
          {
              SeparatorChar = ';',
              MaximumNbrExceptions = -1,
              FileCultureName = "sv-SE"
          };
  
  
          CsvContext cc = new CsvContext();
  
          IEnumerable&lt;LinqData&gt; CSVelements =
              cc.Read&lt;LinqData&gt;(@"C:\sample.csv", inputFileDescription);
          return CSVelements;
      }
  
     public LinqToCSV()
      {
          var inputFileDescription = new CsvFileDescription
          {
              SeparatorChar = ';',
              MaximumNbrExceptions = -1,
              FileCultureName = "sv-SE"
          };
          CsvContext cc = new CsvContext();
  
          IEnumerable&lt;LinqData&gt; CSVelements =
              cc.Read&lt;LinqData&gt;(@"C:\sample.csv", inputFileDescription);
  
          var CSVelementNames = from p in CSVelements
                                orderby p.col1
                                select new { p.col1, p.col2 };
  
          foreach (var item in CSVelementNames) { Console.WriteLine(item); }
      }
  }
  </code></pre>
  
  <p>Thanks in advance for the kind help.</p>