FileInfo的显示一个奇特的日期 [英] FileInfo displaying a peculiar date
本文介绍了FileInfo的显示一个奇特的日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
为什么下面显示1600年12月31日???
Why does the following display 12/31/1600 ???
Imports System.IO
Module Module1
Sub Main()
Dim fi As New FileInfo("DocFiles\phillips_phone_number.txt")
Console.WriteLine(fi.FullName)
Console.WriteLine(fi.LastAccessTime.ToShortDateString)
Console.ReadKey()
End Sub
前端模块
推荐答案
看来,code是无法找到文件,请参阅SDK中的 http://msdn.microsoft.com/en-us/library/system.io.file .getlastaccesstime.aspx
It seems that code is not able to find the file, see the documentation for the GetLastAccessTime function in the SDK http://msdn.microsoft.com/en-us/library/system.io.file.getlastaccesstime.aspx
据指出,
如果在文件中的路径描述 参数不存在,该方法 返回午夜12点,1月1日, 公元1601(C.E.)协调通用 时间(UTC),调整为本地时间。
If the file described in the path parameter does not exist, this method returns 12:00 midnight, January 1, 1601 A.D. (C.E.) Coordinated Universal Time (UTC), adjusted to local time.
这篇关于FileInfo的显示一个奇特的日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文