AndyGB4
Posts: 122
|
Posted: 03/07/2013, 2:25 PM |
|
I'm trying to get Today's date, and add 30 days to it.
I found some documentation to help me out with that, but I keep getting this error any time I try to get today's date. (Error on line 1730)
Index was outside the bounds of the array.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.IndexOutOfRangeException: Index was outside the bounds of the array.
Source Error:
Line 1728: parts[0] = CurrentDate.Year.ToString("0000");
Line 1729: }
Line 1730: if (!DateTime.TryParseExact(parts[1], "MM", System.Threading.Thread.CurrentThread.CurrentCulture.DateTimeFormat, System.Globalization.DateTimeStyles.None, out dummyDate))
Line 1731: {
Line 1732: parts[1] = CurrentDate.Month.ToString("00");
Source File: c:\inetpub\Viniserve\App_Code\InMotion\Web\Controls\Calendar.cs Line: 1730
I've tried so many ways, using MTDateTime or just Date, and retrieving DateTime.Now, but I always get an Index Out of Bounds error... So I'm guessing it has something to do with "parts[1]".
Any ideas?
|