Fix XmlWriterTraceListenerTests handling of DateTime (dotnet/corefx#35692)
Some of these tests compare a textual date time from an XmlWriterTraceListener (which internally uses DateTime.Now) against a textual date time from a TraceEventCache (which internally uses DateTime.UtcNow). This means that there's a few hour window (depending on time zone) at the transition of every month where the months end up differing and the test fails.
The tests also have a bug in that the format string used is buggy and isn't actually resulting in day and year being included, just month. And further, even if the time zones are fixed, it's still possible but rare that taking the Now at two different moments could straddle a boundary. So, rather than comparing ToStrings, we just compare the DateTimes, albeit with an allowed window.
Commit migrated from https://github.com/dotnet/corefx/commit/
1b80f1e1da2630b8fe877a35c285d9c4ffe9f2ce