Loading ...
Sorry, an error occurred while loading the content.

542Re: [bang-phpug] Re: need help to display system time clock in php

Expand Messages
  • Ved Prakash
    Jun 1, 2007
      Hi Bhavna,

      Perhaps this would solve your query.

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

      function startclock()
      {
      var thetime=new Date();
      //var mins=new Date();
      //var secn=new Date();

      var nhours=thetime.getHours();
      var nmins=thetime.getMinutes();
      var nsecn=thetime.getSeconds();
      var AorP=" ";

      if (nhours>=12)
      AorP="P.M.";
      else
      AorP="A.M.";

      if (nhours>=13)
      nhours-=12;

      if (nhours==0)
      nhours=12;

      if (nsecn<10)
      nsecn="0"+nsecn;

      if (nmins<10)
      nmins="0"+nmins;

      document.clockform.txtClock.value=nhours+": "+nmins+": "+nsecn+" "+AorP;

      setTimeout('startclock()',1000);

      }

      //-->


      </SCRIPT>


      <BODY onLoad="startclock()">
      <FORM name="clockform">
      Current Time: <INPUT TYPE="text" name="txtClock" size="15">
      </FORM>
      </BODY>


      Regards,

      Ved

      On 6/1/07, bhavna_coolinus <bhavna_coolinus@...> wrote:
      >
      > I am not getting you what your suggetion is please clarify it.
      >
      >
      >


      [Non-text portions of this message have been removed]
    • Show all 4 messages in this topic