The 53-year-old had pleaded guilty in May to sending explicit photographs and messages to a 15-year-old high school student last year as his wife worked on Clinton's presidential campaign.
"This is a serious crime that deserves serious punishment," US District Judge Denise Cote said as she handed down the sentence, according to a statement from prosecutors.
Acting Manhattan US Attorney Joon Kim said Weiner "asked a girl who he knew to be 15 years old to display her naked body and engage in sexually explicit behavior for him online."
Weiner, once a rising talent in the Democratic Party and candidate for New York mayor, is the estranged husband of Huma Abedin, Clinton's senior advisor during her failed White House campaign last year.
More From This Section
Weiner was forced to resign his seat in Congress in 2011 after a similar scandal in which he admitted to exchanging sexually explicit pictures and messages with at least six women. His wife stood by him at the time.
As a result the FBI effectively re-opened its probe just weeks before the presidential election, a fact that Clinton has said played a key role in her shock defeat to Donald Trump.