New York City’s nonunion municipal workers will soon be able to take six weeks of parental leave under an executive order to be signed by Mayor Bill de Blasio.

The new policy, which affects 20,000 employees, covers maternity, paternity, adoption and foster care leave and will provide 100 percent of salary and job protection, the mayor’s office said Tuesday.

“No one should miss the sweet miracle of those early weeks because they are forced to choose between paying their bills and taking care of their baby,” de Blasio’s wife, Chirlane McCray, said in a statement.

Combined with other existing leave, such as vacation time and sick days, a worker can take up to 12 weeks for the parental leave beginning Jan. 1, 2016.

The change won’t cost the city any more money, officials said. It’s being paid for by cutting two vacation days from the city’s most veteran workers — those who have been on the job about 15 or more years , de Blasio spokeswoman Amy Spitalnick said — and “re-purposing,” or canceling, a planned raise in 2017, the mayor’s office said.

Examples of nonunion jobs include budget analysts, secretaries and legislative assistants, Spitalnick said.

advertisement | advertise on newsday

The unions representing the city’s nearly 300,000 unionized workers would need to negotiate for a similar benefit for their membership.

In a prepared statement, United Federation of Teachers President Michael Mulgrew said union leaders” have been “trying for years” to get mayors to expand parental leave, and “finally have a willing partner on an issue that is very important to us.” Mulgrew said the union is looking forward to negotiating the benefit into its contract.

The union 32BJ, which represents building-services workers, said its leaders also “look forward to working with the administration on this policy.”

According to de Blasio’s office, “families that benefit from paid leave are less likely to receive public assistance, and that the program can substantially reduce infant mortality rates and improve a child’s overall health.”

De Blasio said that New York City’s new policy puts it “in line with the most generous localities in the country, Austin and Pittsburgh.”