开发者

What is the difference between File.SetCreationTime() and File.SetCreationTimeUtc()

开发者 https://www.devze.com 2023-01-19 02:01 出处:网络
In particular, is there any difference between these two lines in terms of their outcomes: File.SetCreationTime(\"foo.txt\", DateTime.UtcNow);

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消