ServiceStack/ServiceStack.Text — pull request #393 by aweber1 (2013-12-30 17:30:39+00:00)
Title: Attempted fix for ToDateTimeSinceUnixEpoch and DateTime.MaxValue

If you pass DateTime.MaxValue to the ToDateTimeSinceUnixEpoch extension method, you may encounter the following exception if the DateTime.Kind is not UTC and if your local time zone UTF offset is negative (e.g. -06:00:00): The added or subtracted value results in an un-representable DateTime.

The ToDateTimeSinceUnixEpoch method attempts to subtract the time zone offset from the provided DateTime argument. If the time zone offset is negative and DateTime is MaxValue, the resulting DateTime is outside the bounds of a valid DateTime.

The edits in this proposed commit are completely untested, and therefore serve more as notification of an edge case issue.