<script>
window.onload = function(){
var hour = new Date(); var h = hour.getHours();
if (h>= 20 && h<=6 && !app.session.user){$('body').addClass('dark');}
}
</script>
But this is not perfect. When you open the homepage, it will turn into a dark mode. But after you open any discussion, the page will no longer be a dark mode unless you refresh the page.I think it's Pjax that makes it impossible to load the dark mode.