Hiragana Clock

[Total: 0    Average: 0/5]

This clock shows the time in Japanese, in hiragana.

Body Code:

<script language="JavaScript">
<!--

//
//
//   Hiragana clock
//
//


var bnum = new Array();
bnum[0]='u308Cu3044';
bnum[1]='u3044u3061';
bnum[2]='u306B';
bnum[3]='u3055u3093';
bnum[4]='u3088u3093';
bnum[5]='u3054';
bnum[6]='u308Du304F';
bnum[7]='u306Au306A';
bnum[8]='u306Fu3061';
bnum[9]='u304Du3085u3046';
bnum[10]='u3058u3085u3046';
var lmnum = new Array();
lmnum[0]='u308Cu3044u3075u3093';
lmnum[1]='u3044u3063u3077u3093';
lmnum[2]='u306Bu3075u3093';
lmnum[3]='u3055u3093u3077u3093';
lmnum[4]='u3088u3093u3077u3093';
lmnum[5]='u3054u3075u3093';
lmnum[6]='u308Du3063u3077u3093';
lmnum[7]='u306Au306Au3075u3093';
lmnum[8]='u306Fu3063u3077u3093';
lmnum[9]='u304Du3085u3046u3075u3093';
lmnum[10]='u3058u3085u3063u3077u3093';
var lhnum = new Array();
lhnum[0]='u308Cu3044u3058';
lhnum[1]='u3044u3061u3058';
lhnum[2]='u306Bu3058';
lhnum[3]='u3055u3093u3058';
lhnum[4]='u3088u3058';
lhnum[5]='u3054u3058';
lhnum[6]='u308Du304Fu3058';
lhnum[7]='u3057u3061u3058';
lhnum[8]='u306Fu3061u3058';
lhnum[9]='u304Fu3058';
lhnum[10]='u3058u3085u3046u3058';
var byou = 'u3073u3087u3046';


function showtime() {

var now = new Date();
var hour = now.getHours();
var minute = now.getMinutes();
var second = now.getSeconds();
var hourpart = '';
var minutepart = '';
var secondpart = '';

if (hour>=0 && hour<=10) {hourpart = lhnum[hour]};
if (hour>=11 && hour<=19) {hourpart = bnum[10] + lhnum[hour-10]};
if (hour==20) {hourpart = bnum[2] + lhnum[10]};
if (hour>=21) {hourpart = bnum[2] + bnum[10] + lhnum[hour-20]};

if (minute>=0 && minute<=10) {minutepart = lmnum[minute]};
if (minute>=11 && minute<=19) {minutepart = bnum[10] + lmnum[minute-10]};
if (minute>=20 && (minute%10)==0) {minutepart = bnum[minute/10] + lmnum[10]};
if (minute>=21 && (minute%10)!=0) {minutepart = bnum[Math.floor(minute/10)] + bnum[10] + lmnum[minute%10]};

if (second>=0 && second<=10) {secondparta = bnum[second]};
if (second>=11 && second<=19) {secondparta = bnum[10] + bnum[second-10]};
if (second>=20 && (second%10)==0) {secondparta = bnum[second/10] + bnum[10]};
if (second>=21 && (second%10)!=0) {secondparta = bnum[Math.floor(second/10)] + bnum[10] + bnum[second%10]};

hirast = hourpart+'u3000'+minutepart+'u3000'+secondparta+byou;
return hirast;
}






function ticktock()
{
  var _info=showtime();
  if(document.getElementById)
    document.getElementById("hiraclock").innerHTML = _info;
  else if(document.all)
    document.all.hiraclock.innerHTML=_info;
}

document.write('<span id="hiraclock">'+showtime()+'</span>');

var myInt=null;
function startInt() {killInt();myInt=setInterval("ticktock();",480);} /* 480 */
function killInt()  {if(myInt)clearInterval(myInt);myInt=null;}
onload=startInt;
onunload=killInt;

//-->
</script>

Times Viewed: 0

Leave a Reply

Your email address will not be published. Required fields are marked *