Investors looking to roll capital gains into a Qualified Opportunity Fund (QOF) must execute the investment within a strict 180-day window starting from the date the capital gain would have been recognized for federal income tax purposes if it had not been deferred. For gains originating from pass-through entities like partnerships or S-corporations, investors typically have alternative start dates options, choosing either the end of the entity's tax year or the date the gain was originally realized, allowing flexible tax planning.