문제

In particular, is there any difference between these two lines in terms of their outcomes:

File.SetCreationTime("foo.txt", DateTime.UtcNow);
File.SetCreationTimeUtc("foo.txt", DateTime.UtcNow);

Perhaps File.SetCreationTimeUtc("foo.txt", DateTime.Now) is just another way of doing File.SetCreationTime("foo.txt", DateTime.UtcNow)?

The same question applies to File.SetLastAccessTime() vs. File.SetLastAccessTimeUtc() and File.SetLastWriteTime() vs. File.SetLastWriteTimeUtc()

도움이 되었습니까?

해결책

The first one will set the wrong time because it is expecting a date expressed in your local time zone.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top