Restaurant worker Ali Heydari, 47, was filling a petrol can alongside his BMW on the Hartlepool forecourt when he was spotted by officers.
The court heard a records check showed that he had previous convictions for carrying blades.
The officers challenged him and inside the footwell of his vehicle he had a kitchen knife.
He also gave a positive drugs test for cocaine.
He was arrested on the spot in Easington Lane, Hartlepool, and he later gave a No Comment interview over the incident on January 17, said prosecutor Shada Mellor.
He had a previous conviction for possession of an axe and another bladed article, and this time he also failed the blood test for driving after taking drugs.
Heydari was under investigation for the earlier blades and on February 18 he was given a suspended six months jail sentence and 20 days rehabilitation activities.
The judge at Teesside Crown Court said that the new combination of a knife and drugs was a serious matter.
Recorder Martin Rose told him: "I have to bear in mind that this was not the first time that you have had a bladed article."
Heydari, a father of two, lost his job in the restaurant trade during the Covid lockdown, said Martin Scarbrough defending
He added: "He accepts that he did not have a good reason for having the knife in the car.
"He is making good progress on the suspended sentence."
The judge told Heydari that he was not going to do anything to upset the good progress.
Heydari, of Ryder Street, Hartlepool, was sentenced to six months jail suspended for 12 months with another 20 rehabilitation days consecutively after he pleaded guilty in the Magistrates Court to drug driving under the influence of cocaine and possession of a bladed article.
He was also disqualified from driving for 12 months and the judge ordered the knife concerned to be forfeited and destroyed.