DateTime.AddDays breaks on ios project

I am using the DateTime.AddDays function on my Unity project, built for iOS. Everything compiles fine and I can run my project through xCode. The dates that I use for my function are correct. However, when I use the “AddDays” function, I suddenly get an “Argumentoutof range” error…
I don’t understand what I’m doing wrong.

public DateTime GetWeekStart(DateTime currTime, DayOfWeek startOfWeek)
    {
	double diff = (double)(currTime.DayOfWeek - startOfWeek);
        if (diff < 0) {
            diff += 7;
        }
	double addAmount = -1 * diff;
	return currTime.AddDays(addAmount);
    }

Here is the error that I’m getting:

ArgumentOutOfRangeException: Argument is out of range.
  at System.DateTime.AddTicks (Int64 value) [0x00000] in <filename unknown>:0 

  at System.DateTime.AddMilliseconds (Double value) [0x00000] in <filename unknown>:0 

  at System.DateTime.AddDays (Double value) [0x00000] in <filename unknown>:0 

  at DataManager.GetWeekStart (DateTime currTime, DayOfWeek startOfWeek) [0x00000] in <filename unknown>:0

Hey!

I have this problem too and it drives me crazy.
All Add-Functions for DateTime seems to be broken.
This problem occures even if you just try to say

Debug.Log(DateTime.Now.AddDays(1));

So i guess you don’t do anything wrong.
I also logged the minValue and MaxValue and they are correctly so I think there is a general problem by the translation to iOS.

You can vote here and only hope to get this issue fixed!

If someone have a workaround, pls help us!

Funny enough, this problem seemed to be related to the simple difference between the way ticks are counted on Windows machine vs. Mac. When I got the chance, I was able to recompile my iOS project on an actual Mac computer - that fixed the problem! So I’m not sure if there is a bug within Unity 4.2.1 that doesn’t convert the ticks properly or what…