Here are two sentences that I want to know I can both use no matter what situation I'm in.
By the time a memorable incident happened, I had been working just for a few weeks.
By the time I had been working just for a few weeks, a memorable incident happened.
I'd like to know if the two sentences are the same. And can I use 'when' in the same way as 'by the time' here?