[Mono-list] DateTime.Today.Day

Duncan Mak duncan@ximian.com
22 Jan 2003 00:04:47 -0500


Hey guys,

I was tired of cal(1) not telling me what the date is, so I wrote my own
in C# last week. It was working fine last week, but I tried it just now
and that's what I got:

diphthong:~ $ date
Tue Jan 21 23:55:11 EST 2003
diphthong:~ $ mono cal.exe 
1/22/2003

Well, I looked at how FromTicks worked and made this patch and now my
calendar is correct again. Should I commit it?


Index: DateTime.cs
===================================================================
RCS file: /cvs/public/mcs/class/corlib/System/DateTime.cs,v
retrieving revision 1.28
diff -u -p -r1.28 DateTime.cs
--- DateTime.cs	19 Dec 2002 05:16:32 -0000	1.28
+++ DateTime.cs	22 Jan 2003 05:04:25 -0000
@@ -103,7 +103,7 @@ namespace System
 			if (what == Which.Month )
 				return M;

-			return totaldays +1; 
+			return totaldays;
 		}
-- 
Duncan Mak <duncan@ximian.com>