$ perl -le '$now=57; $then=12; print +($then-$now)%60' 15