Shane Woolley, 48, of no fixed abode, was sentenced to 26 weeks in prison after he was found to be in possession of aÂ black handled kitchen knife.
This followed an incident where Woolley presented himself to officers at Doncaster station and claimed to be suffering mental illness which was found not to be the case.Â
Following medical checks, he was later arrested for carrying the knife after admitting he wanted a bed for the night.Â
The court deemed the offence so serious that they imposed the sentence as it was the second offence without good reason, or lawful authority being found with a knife in a public place.
He was also made to pay the victim surcharge of Â£155, and an order was made for the destruction of the knife.
A spokesperson for British Transport police said: 'This sends out a clear message carry a knife '“Â risk jail for Christmas.'