The man was granted temporary name suppression, which prevented his name being published in the media.
He was remanded in custody and will reappear in court on Monday morning.
At a press conference after the incident, Counties Manukau Area Commander Inspector Adam Pyne said the woman was not known to the alleged offender and was "picked randomly".
Police were called at 8.50am to the hostage situation and were at the scene within minutes, he said.
"The first officer on the scene immediately began negotiations."
Police negotiated for about 40 minutes before the man dropped the knife, which had a 12.5cm blade, and released the victim.
The knife had been held to her throat and the Armed Offenders Squad had been called, he said.
"It took a long time but eventually they were able to diffuse the situation," he said.
"The victim in this matter is understandably shaken but fortunately was not harmed by the alleged offender."
It was obviously an extremely distressing situation, he said.
"I want to acknowledge the bravery of the victim in this incident, who remained calm in a stressful and traumatic situation and we are providing her with all the support we can."