Results 1 to 5 of 5

Thread: Script for Advanced status clock

  1. #1
    Join Date
    Nov 2009
    Posts
    43

    Script for Advanced status clock

    Hello friends,

    I am creating a project in java where i need to add some script for advance Status clock, i had try to write it by myself but was not able to write it can anyone tell me which method function i should use it and what are it's function use for. Any suggestion would be appreciated and if possible also provide me code which i can use it in my program.

  2. #2
    Join Date
    Jan 2009
    Posts
    126

    Script for Advanced status clock

    In such kind of case you need to make changes in data which you get it from Date object constructor, by using this object and some methods you can easily create your own JavaScript clock as per your requirements without any issue and if you want you can also customize it as per your requirements and for that you need to some functions like getHours(), getMinutes(), getSeconds(), getDate(), getDay() etc.

  3. #3
    Join Date
    Dec 2008
    Posts
    182

    JavaScript Status clock

    I had created code in java script for status clock i how it would be some what helpful for you please have a check and if you don't understand anything then let me know.

    Code:
    <script type="text/javascript">
    function time(){
    var1 currentDate=new Date()
    var1 TimeStamp,month,period,day,year1;
    hrs=currentDate.getHours()
    min1=currentDate.getMinutes()
    secnds=currentDate.getSeconds()
    year1=currentDate.getFullYear()
    date1=currentDate.getDate()
    
    switch(currentDate.getDay()){
    case 0:day="Sunday";break;
    case 1:day="Monday";break;
    case 2:day="Tuesday";break;
    case 3:day="Wednesday";break;
    case 4:day="Thursday";break;
    case 5:day="Friday";break;
    case 6:day="Saterday";break;
    }
    switch(currentDate.getMonth()){
    case 0:month="January";break;
    case 1:month="Febuary";break;
    case 2:month="March";break;
    case 3:month="April";break;
    case 4:month="May";break;
    case 5:month="June";break;
    case 6:month="July";break;
    case 7:month="August";break;
    case 8:month="September";break;
    case 9:month="October";break;
    case 10:month="November";break;
    case 11:month="December";break;
    }
    
    if(secnds<10){secnds="0"+secnds}
    if(min1<10){min1="0"+min1}
    
    if(hour>12){hrs-=12;period="pm"} else {period="am"}
    if(currentDate.getHours()==12){period="pm"}
    if(currentDate.getHours()==24){period="am"}
    
    var1 TimeStamp=day+" "+month+" "+date1+" "+year1+" "+hrs+":"+min1+":"+secnds+" "+period
    window.status=TimeStamp
    window.setTimeout("time()",300)
    }
    time()
    </script>

  4. #4
    Join Date
    Nov 2009
    Posts
    43

    Script for Advanced status clock

    Thank you for replying me it would be great if you can explain me followign line of code

    Code:
    var TimeStamp, month, period, day, year;
    hour = currentDate.getHours()
    min = currentDate.getMinutes()
    sec = currentDate.getSeconds()
    year = currentDate.getFullYear()
    date = currentDate.getDate()

  5. #5
    Join Date
    Dec 2008
    Posts
    182

    Script for Advanced status clock

    I had use var1 currentDate=new Date() for creating date object and i had use this object because it can handle multiple values and as everyone knows variable can store only one value at one time. After that i had used getMinutes(), getSeconds(), getHours(), getDate(), getMonth(),getDay(), getFullYear() methods which will get the required parameter stored in variable.

Similar Threads

  1. status disk? status.msi
    By GanGadUtt in forum Windows XP Support
    Replies: 7
    Last Post: 01-04-2012, 02:18 AM
  2. Script to show server status
    By Rain-Saibot in forum Software Development
    Replies: 4
    Last Post: 23-08-2010, 08:50 PM
  3. Replies: 3
    Last Post: 22-07-2009, 09:14 PM
  4. Word 2008 + bibfuse: no script in script menu
    By deval4u in forum Software Development
    Replies: 5
    Last Post: 06-04-2009, 12:53 PM
  5. Replies: 2
    Last Post: 14-01-2009, 01:25 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,539,667.81959 seconds with 17 queries