Kod · PHP
<?php
$now_hours = date('G');
if($now_hours<8)
{
echo 'Tun';
}
elseif($now_hours<12 && $now_hours>=8 )
{
echo 'Tong';
}
elseif($now_hours>=12 && $now_hours<17)
{
echo 'Kun';
}
elseif($now_hours>=17 && $now_hours<=23)
{
echo 'Oqshom';
}
?>JS da
Kod · JavaScript
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script language="JavaScript">
var h=(new Date()).getHours();
if (h > 23 || h <7) document.write('Tun') ;
if (h > 6 && h < 12) document.write('Tong');
if (h > 11 && h < 19) document.write('Kun');
if (h > 18 && h < 24) document. write('Oqshom');
</script>