Author: jonpryor
Date: 2005-04-29 16:33:45 -0400 (Fri, 29 Apr 2005)
New Revision: 43805
Modified:
trunk/mcs/class/Mono.Posix/Mono.Unix/ChangeLog
trunk/mcs/class/Mono.Posix/Mono.Unix/UnixConvert.cs
Log:
* UnixConvert.cs: Fix time_t -> DateTime conversions. time_t should be
assumed to be in the local time zone, so don't mess with UTC shifts.
This allows Mono.Unix to produce sane output (e.g. identical to ls(1) or
stat(1), instead of several hours different).
Modified: trunk/mcs/class/Mono.Posix/Mono.Unix/ChangeLog
===================================================================
--- trunk/mcs/class/Mono.Posix/Mono.Unix/ChangeLog 2005-04-29 20:29:24 UTC
(rev 43804)
+++ trunk/mcs/class/Mono.Posix/Mono.Unix/ChangeLog 2005-04-29 20:33:45 UTC
(rev 43805)
@@ -1,5 +1,12 @@
2005-04-29 Jonathan Pryor <[EMAIL PROTECTED]>
+ * UnixConvert.cs: Fix time_t -> DateTime conversions. time_t should be
+ assumed to be in the local time zone, so don't mess with UTC shifts.
+ This allows Mono.Unix to produce sane output (e.g. identical to ls(1)
or
+ stat(1), instead of several hours different).
+
+2005-04-29 Jonathan Pryor <[EMAIL PROTECTED]>
+
* Stdlib.cs: Make FilePosition slightly more useful by providing a
ToString() override which dumps the fpos_t structure contents into a
hex string. Add Equals(), GetHashCode(), operator==, and operator!=
Modified: trunk/mcs/class/Mono.Posix/Mono.Unix/UnixConvert.cs
===================================================================
--- trunk/mcs/class/Mono.Posix/Mono.Unix/UnixConvert.cs 2005-04-29 20:29:24 UTC
(rev 43804)
+++ trunk/mcs/class/Mono.Posix/Mono.Unix/UnixConvert.cs 2005-04-29 20:33:45 UTC
(rev 43805)
@@ -708,8 +708,6 @@
public static readonly DateTime LocalUnixEpoch =
new DateTime (1970, 1, 1).ToLocalTime();
- public static readonly long UtcOffset =
- (long) (DateTime.Now.Subtract
(DateTime.UtcNow).TotalSeconds);
public static DateTime ToDateTime (long time)
{
@@ -723,10 +721,7 @@
public static DateTime FromTimeT (long time)
{
- // Console.WriteLine ("** LocalUnixEpoch={0};
UtcOffset={1}; time={2}", LocalUnixEpoch, UtcOffset, time);
-
- DateTime r = LocalUnixEpoch.AddSeconds (time +
UtcOffset);
- // Console.WriteLine ("** result={0}", r);
+ DateTime r = LocalUnixEpoch.AddSeconds (time);
return r;
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches