DateTime conversion not working c#
<p><strong>EDIT</strong> I have completely edited the code, since a lot of my strange attempts at fixing the basic error were misleading people to believe there were errors in my code, when it was simply trying any and all apprches to solving the problem. The many myriad of ways I have attempted to convert a perfectly valid, BUILT IN date time format to system datetime object has failed, and don't know why.</p>

<p><strong>endedit</strong></p>

<p>I need help, I have literally just ripped some hair out as a result of being unable to solve such a seemingly simple task, trying to convert my date log (a csv, which is reading correctly) to DateTime. the error is in trying to convert my log entries (which when printed, are correctly formatted date times) to DateTime Objects for comparison.</p>

<pre><code>EXAMPLE INPUT FROM CSV: 2016-03-22T04:03:31
EXAMPLE INPUT FROM File.GetLastWriteUTC(path): 2016-03-22T04:03:27
</code></pre>

<p>Both are identical, but I can't convert my csv log entries to <code>DateTime</code> for no particular reason.</p>

<p>I have tried any number of formats. I am writing to the console which proves that the dates that I am working with are indeed correct C# compatible date time formats. I have tried DateTime.Parse/ParseExact with every parameter I can find online. I am even trying to remap a new date time to a new format, or converting the string, to date time, back to string with a format, and converting that PROPERLY FORMATTED STRING back to a date time. </p>

<p>And yet, every time I run my program, I'm left with "When converting a string to DateTime, parse the string to take the date before putting each variable into the DateTime object." And "Make sure your arguments are in the same format", though I have PROVEN that they are beyond a shadow of a doubt the correct format, no missing zero's, and no single quotations. I'm writing out built in formats using the .ToString modifiers, I have went down the list trying f, F o, O, s, S, etc. </p>

<p>Someone please save my sanity. Below you can see a number of my brain fried hackish attempts to figure out why this isn't working, and just when I think I've come up with something clever, GUARANTEEING the correct format, it still fails. </p>

<pre><code>        using System;
using System.Collections.Generic;
using System.Data.SqlTypes;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;

namespace vimbackupscript2
{
    class Program
    {
        static void Main()
        {
            while (true)
            {
                FileSystemWatcher watcher = new FileSystemWatcher();
                watcher.Path = "C:\\Program Files\\Git\\etc";
                watcher.NotifyFilter = NotifyFilters.LastWrite | NotifyFilters.FileName | NotifyFilters.LastWrite;
                DateTime time = File.GetLastWriteTimeUtc(watcher.Path + "\\vimrc");
                string logPath = "C:\\Users\\USERPROFILE\\vimbackup\\log.csv";
                var logFile = File.ReadAllText(logPath).Split(',');

                foreach (var log in logFile)
                {
                    Console.WriteLine(Convert.ToDateTime(log));

                }

                watcher.Changed += new FileSystemEventHandler(OnChanged);

                watcher.WaitForChanged(WatcherChangeTypes.All);

                File.WriteAllText(logPath, time.ToString("s") + ",");
            }

        }


    }
</code></pre>

<p>}</p>