From defd08ff8985cf158e4a93791aaf59572ac312fe Mon Sep 17 00:00:00 2001 From: Miguel de Icaza Date: Mon, 4 Dec 2006 01:01:58 +0000 Subject: [PATCH] 2006-12-03 Miguel de Icaza * DateTime.cs: Fix this on the 2.0 profile, return the DateTimeKind for the Now property svn path=/trunk/mcs/; revision=68917 --- mcs/class/corlib/System/ChangeLog | 5 +++++ mcs/class/corlib/System/DateTime.cs | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/mcs/class/corlib/System/ChangeLog b/mcs/class/corlib/System/ChangeLog index 986d9da4265..9212d2931aa 100644 --- a/mcs/class/corlib/System/ChangeLog +++ b/mcs/class/corlib/System/ChangeLog @@ -1,3 +1,8 @@ +2006-12-03 Miguel de Icaza + + * DateTime.cs: Fix this on the 2.0 profile, return the + DateTimeKind for the Now property + 2006-12-01 Duncan Mak * ArgumentOutOfRangeException.cs (.ctor): diff --git a/mcs/class/corlib/System/DateTime.cs b/mcs/class/corlib/System/DateTime.cs index 9d047e3cda9..464cfa55f9d 100644 --- a/mcs/class/corlib/System/DateTime.cs +++ b/mcs/class/corlib/System/DateTime.cs @@ -432,7 +432,7 @@ namespace System { long now = GetNow (); DateTime dt = new DateTime (now); - + if ((now - last_now) > TimeSpan.TicksPerMinute){ to_local_time_span_object = TimeZone.CurrentTimeZone.GetLocalTimeDiff (dt); last_now = now; @@ -440,7 +440,11 @@ namespace System } // This is boxed, so we avoid locking. - return dt + (TimeSpan) to_local_time_span_object; + DateTime ret = dt + (TimeSpan) to_local_time_span_object; +#if NET_2_0 + ret.kind = DateTimeKind.Local; +#endif + return ret; } } -- 2.25.1