Ignore milliseconds when comparing two datetimes

前端 未结 14 2156
一个人的身影
一个人的身影 2020-12-08 12:47

This is probably a dumb question, but I cannot seem to figure it out. I am comparing the LastWriteTime of two files, however it is always failing because the file I download

14条回答
  •  囚心锁ツ
    2020-12-08 13:09

    cast sortable strings and compare. simple and run well.

        return string.Compare(dtOrig.ToString("s"), dtNew.ToString("s"), 
    StringComparison.Ordinal) == 0;
    

提交回复
热议问题