I say, and with God's success: The minimum I'tikaf in voluntary acts is one hour, even if one is passing through the mosque, even at night, and this is the opinion given; because voluntary acts are based on leniency, and an hour in the understanding of jurists is a part of time, and it does not have a specific limit. Even if one enters the mosque and intends to perform I'tikaf until they leave, it is valid. I'tikaf is a way for someone who wants to enter through one door of the mosque and exit through another so that it does not become a path; because that is not permissible. Refer to: Kanz al-Daqaiq 1: 350, Durar al-Hukam 1: 213, Al-Durr al-Mukhtar 1: 131, Al-Durr al-Muntaka 1: 256, Hashiyat al-Tahawi 1 p. 474, Al-Hadiyya al-Alaiyya p. 184, and God knows best.