I don't think I've ever gone that long. I work in fast food and while I mostly work in the back, i still have to interact with customers at times. Most of my coworkers are gen z and aside from the managers there's only like 1 or 2 women close to my age. But 3 of the 4 managers are female. One is pretty close to my age, one is i think early gen x and one is late millennial. Not sure how "close" counts as "close" to you though.
I worked a few warehouse jobs that were ~90 percent male, but that didn't make women so uncommon that I could go weeks without talking to a single one.
I was NEET for a while many years ago, but back then I was cold approaching women. I was also in social circles back then that had women in them.
That said you included "outside of a workplace or professional setting" as a criterion, my answer would be "years".