Social Order Maintenance Act Article 54

Detention starts from the moment when a person is taken into detention and twenty four hours of detention makes up a day.A detainee will be released after a full term is served. If the release time falls between midnight and 8 a.m., a detainee may, with their prior consent be released at 8 a.m.
中文原文 社會秩序維護法第54條
拘留之執行,即時起算,並以二十四小時為一日。
前項執行,期滿釋放。
但於零時至八時間期滿者,得經本人同意於當日八時釋放之。

English translation for reference only; the Chinese text prevails. Not legal advice.