Here's the two pertinent quotes from CNN in a story they published in July of 2016 titled "Sources: US officials warned DNC of hack months before the party acted":
"Federal investigators tried to warn the Democratic National Committee about a potential intrusion in their computer network months before the party moved to try to fix the problem, U.S. officials briefed on the probe tell CNN.
"The DNC brought in consultants from the private security firm CrowdStrike in April. And by the time suspected Russian hackers were kicked out of the DNC network in June , the hackers had been inside for about a year."Therefore, we now know that the Russian hacking actually started almost 1-1/2 years before the election of Donald Trump.
This is why the narrative that the Russian government wanted Trump to win the presidency is nothing but fake news. Unless they had some miracle crystal ball, they started the hacking of the DNC well before anyone ever thought that Trump would be the GOP nominee, let alone be elected. But, that's the story being concocted in order to prove that Hillary didn't lose because she was simply a bad candidate; or, at least worse than the other bad candidate.
FBI took months to warn Democrats of suspected Russian role in hack: sources: http://www.reuters.com/article/us-usa-cyber-democrats-reconstruct-idUSKCN10E09H
Sources: US officials warned DNC of hack months before the party acted: http://www.cnn.com/2016/07/25/politics/democratic-convention-dnc-emails-russia/