Show Time In Your Blog Or Website

12:33:44 AM

How To Show Time In Your Blog Or Website

  1. Open Notepad
  2. Create Javascript File
  3. Then Type In Javascript File
  4. Type
    var d=new Date();
    var curHour=d.getHours();
    var curMinute=d.getMinutes();
    var curSecond=d.getSeconds();
    var ampm;
    if(curHour<12)
    { ampm="AM"; }
    else{ ampm="PM"; }
    if(curHour==0)
    { curHour=12; }
    if(curHour>12)
    { curHour=curHour-12; }
    document.write(curHour+":"+curMinute+":"+curSecond+" "+ampm);

Post a Comment

Post a Comment (0)

Previous Post Next Post