123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128 |
- function getHours() {
- var today = new Date();
- if (today.getHours() < 10) return ("0" + today.getHours().toString());
- return today.getHours();
- }
- function getMinutes() {
- var today = new Date();
- if (today.getMinutes() < 10) return "0" + today.getMinutes().toString();
- return today.getMinutes();
- }
- function getSeconds() {
- var today = new Date();
- if (today.getSeconds() < 10) return "0" + today.getSeconds();
- return today.getSeconds();
- }
- function getTimeJS(hours,minutes,seconds) {
- var time = "";
- if(hours) time += getHours();
- if(hours && minutes) time += ":";
- if(minutes) time += getMinutes() ;
- if((minutes || hours) && seconds ) time += ":"
- if(seconds) time += getSeconds();
- return time;
- }
- function formatTwoDigits(number) {
- if(number < 10) return "0" + number;
- return number;
- }
- function parseIntClever(number) {
- if (number.length == 2 && number.charAt(0) == "0") return parseInt(number.charAt(1));
- return parseInt(number)
- }
|