Attending Friday prayers is obligatory for Muslim men in Malaysia, but it is rare for such harsh punishments to be meted out for missing them.
Aged 17-to-35, the men had been caught having a picnic by a waterfall instead of taking part in prayers on a Friday, the holiest day of the week for Muslims, newspaper Harian Metro reported.
They were also fined between 2,400 and 2,500 ringgit ($575-$600) each after pleading guilty on Sunday in a sharia court in the conservative northeastern state of Terengganu.
They are still free on bail while they appeal the sentences. They could had been jailed for a maximum of two years under Muslim-majority Malaysia's Sharia laws.
"The alleged failure to attend Friday prayers is a personal matter," Zaid Malek, from rights group Lawyers for Liberty, said in a statement.
"While such acts may be considered improper by some in Muslim society, criminal punishment is excessive and not the way to address them."
He also said the sentences ran counter to pledges from the religious affairs minister to focus on rehabilitation of criminals, rather than punishment.
Critics said the case highlighted that a traditionally tolerant brand of Islam in Malaysia was being eroded, and it came weeks after four men were caned for having gay sex in violation of sharia laws.
Malaysia has a dual-track legal system, with sharia courts handling some cases for Muslim citizens.
Some 60 percent of Malaysia's 32 million people are ethnic Malay Muslims and the country is also home to substantial ethnic Indian and Chinese communities, who do not usually follow Islam.
Follow us on Twitter and Instagram to stay connected