This project has moved and is read-only. For the latest updates, please go here.

Incorrect date time format when writing out large files

Jan 24, 2013 at 10:29 PM

I read large json file, change certain things and then write it back to disk:

using (var reader = new StreamReader(filePath))
                var log = (JObject)JToken.ReadFrom(new JsonTextReader(reader));
                //log = UpdateOneLog(log);
                using (var writer = new StreamWriter(updateFilePath))
                    log.WriteTo(new JsonTextWriter(writer));

Weird things happen for certain files and I believe it has something to do with file size. The date time should be startedDateTime":"2013-01-17T11:00:40.000-06:00" but it gets written to the file as startedDateTime":"2013-01-17T11:00:40-06:00" (note that fractions of the second "000" is missing).  I even commented out my update logic as shown above. All I am doing is reading file and writing it back but the date gets garbled..

Am I doing something wrong?