Matthew Burns pleaded guilty to sending online threats to Ms Ardern, and London Mayor Sadiq Khan.
Burns tweeted a photo of a gun to Ms Ardern following the Christchurch attacks adding "you're next".
Burns, of Newtownhamilton, faced five charges.
The prosecution outlined the background to the case, which began when the New Zealand authorities alerted the police service of Northern Ireland's cybercrime unit to Twitter death threats made against Ms Ardern following the Christchurch mosque shootings.
Burns also threatened the London mayor and his wife on social media saying, "it would be a shame if something happened to her… like a bullet in the head and him too".
At Newry Magistrates' Court, district judge Eamonn King said Burns' online behaviour had created a "monster".
"I can understand that if there are issues in real life, that you don't get a buzz in real life, you hope to get it on social media, and what happens… you create a monster," he said.
"When you put offensive comments online you are met with a blizzard of responses and engagement. That increases your feeling of self-worth. You feel more important.
"Someone is listening to you and it increases your self-esteem, so you then say something even more outrageous and that escalates and escalates."
'Myriad of issues'
Burns, who previously had no record, faced five counts of improper use of electronic communications, with messages of a menacing and grossly offensive nature on dates from 14 June 2018 to 20 March 2019.
Defence barrister Kevin Magill said Burns' mother had been concerned about his behaviour before the offending and had previously sought help from a GP and other services.
"Steps were taken by his family using private services," he said.
"They were not preparing reports for court but aiming to address his issues.
"He has a myriad of issues, which are now being dealt with," added the barrister.
The judge said the New Zealand authorities did not want him to be prosecuted but "spoken to".
He said the sentence "will get you out from behind your smartphone and iPad, for you to engage with people".
"If you do not complete it, you will be brought back to court for a custodial sentence," he added.