Lynden Arnold brandished a kitchen knife and threatened to rob the driver, Sheffield Crown Court was told.
He then asked to be taken to the police station, where he was arrested.
The court heard how at 6.45am on January 4, Arnold got into a taxi and asked to be taken to the Jet petrol station in Balby Road, Hexthorpe.
After paying the fare of £5 upfront, Arnold, of no fixed address, began threatening the taxi driver.
Prosecutor Carl Fitch told the court: “The defendant demanded that the taxi driver stopped, and said he had a knife.
“He said ‘I’ll stab you if you don’t give me the money,’ and produced a kitchen knife with a blade about three inches long.
“The driver carried on and said I thought you wanted to go to Balby Road.
“The defendant said: ‘I’ve robbed you, now take me to the police station’.”
The driver then drove Arnold, who previously worked as a nurse, to the nearest police station, honked his horn to alert officers and got out the taxi shouting ‘he’s got a knife’.”
At the time of the incident, Arnold was in a downward spiral in terms of his mental health following the death of his father and committed the offence as a ‘cry for help,’ the court heard.
Mr Fitch said the circumstances of this incident were very similar to that of one carried out by Arnold on August 22 last year, when he attempted to rob a Doncaster petrol station at knife point but then did not take the money when it was given to him.
Arnold received a sentence of six months, suspended for a year when he appeared before the court for that offence in October last year.
He admitted to one count of possession of a bladed weapon and one count of affray in relation to this offence at an earlier hearing.
Sentencing Arnold to a year in prison, Recorder David Preston said: “This is a sad case, and a difficult case, involving a man who has had problems over the year.”