Images and Graphics . 461 24-hour military time (Unlimited web hosting)
Thursday, January 31st, 2008Images and Graphics . 461 24-hour military time notation to 12-hour notation. Pay attention, also, to the concatenation of a null string to force the conversion to a string, needed for the charAt() method. The returned value is converted backto integer format. getMinute(place) functiongetMinute(place) { varnow=newDate() varminute=now.getMinutes() if(minute<10) minute="0"+minute//donotparsenumber! minute+="" returnparseInt(minute.charAt(place)) } This function is similar to the getHour() function. See the listing for that function. getAmpm() functiongetAmpm() { varnow=newDate() varhour=now.getHours() if(hour>=12) return11//pm/*else*/ return10//am} The getAmpm() function returns 11 if the current time is P.M., and 10 if it is A.M. Notice that, since a return statement immediately terminates a function, the else keyword is not needed here and is commented out. getPath(url) functiongetPath(url) { lastSlash=url.lastIndexOf(”/”) returnurl.substring(0,lastSlash+1) } Chapter The script s last function, getPath(), extracts the full URL of the document s directory (or folder). It simply finds the last slash in the URL and returns the substring, starting at the beginning of the URL and ending at its last slash. Demonstration 2: LED Sign You have probably seen LED signs in airports and bulletin boards. This LED sign displays a given number of messages, one after the other, and returns to the first one
If you are looking for cheap and quality webhost to host and run your website check Jboss Web Hosting services.