I tried graveyards and swing shifts in my twenties. I only did it for a year, but it wrecked my sleep schedule for years afterward; I struggled with insomnia because of it. Not sure there is any age where this works.
Some people can handle it better than others. I'll never do it again though.