You can override the Mage_Checkout_Helper_Data::canOnepageCheckout
method.
That one checks if you can perform a onepage checkout and add your restriction in there.
In your new class you can make it look like this:
<?php
class [Namespace]_Checkout_Helper_Data extends Mage_Checkout_Helper_Data {
public function canOnepageCheckout(){
$from = '0:00';
$to = '3:00';
//you can make the values above come from a config setting
$fromParts = explode(':', $from);
$toParts = explode(':', $to);
$nowHour = date('H');
$nowMinutes = date('i');
if ($nowHour > $fromParts[0] ||
($nowHour == $fromParts[0] && $nowMinutes >= $fromParts[1])) &&
($nowHour < $toParts[0] || ($nowHour == $toParts[0] && $nowMinutes <= $toParts[1]))
){ //dont allow checkout between the specified hours.
return false;
}
return parent::canOnepageCheckout();
}
}
I hope I closed all the brackets right.
You can do the same for the multishipping if you have it enabled.
For multishipping the method is in the same helper and it's called isMultishippingCheckoutAvailable
.