当 + Subject + Verb + 时
当 (dāng) is a conjunction meaning 'when' or 'at the time of.' It introduces a time clause that sets the scene for the main action. It is often paired with 时 at the end of the clause, as in 当她走近时 (when she approached).
当我到家的时候,妈妈已经做好饭了。
Dāng wǒ dào jiā de shíhou, māma yǐjīng zuò hǎo fàn le.
By the time I got home, Mom had already finished cooking.
当她听到这个消息时,非常高兴。
Dāng tā tīng dào zhège xiāoxi shí, fēicháng gāoxìng.
When she heard the news, she was very happy.
当你不确定的时候,可以问我。
Dāng nǐ bù quèdìng de shíhou, kěyǐ wèn wǒ.
When you're not sure, you can ask me.