[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [DotGNU]System/IO/File.cs ... silly doubt
From: |
Rhys Weatherley |
Subject: |
Re: [DotGNU]System/IO/File.cs ... silly doubt |
Date: |
Mon, 23 Sep 2002 08:30:52 +1000 |
Gopal V wrote:
>
> public static DateTime GetLastAccessTime(string path)
> {
> long time;
> DirMethods.GetLastAccess(path, out time);
> DateTime datetime = new DateTime(time);
> return
> DateTime.Parse(String.Concat(datetime.ToShortDateString(), " ",
> datetime.ToShortDateString()));
> }
>
> What is the last line for ? .. why wouldn't 'return datetime' work ?
Yes it would, if "time" is in ticks. The "GetLastAccess" internalcall
isn't currently implemented (volunteers wanted). It needs to do a stat
and return the time value in ticks.
Ticks are "100 nanosecond" units since Jan 1, 0001. See the
"GetCurrentTime" internalcall in "lib_time.c" and the function
"ILGetCurrTime" in "support/time.c" for an example of converting
between Unix time values and ticks.
Cheers,
Rhys.