| | |
| | | public int hour; //时 |
| | | public int minute; //分 |
| | | public int second; //秒 |
| | | |
| | | public String testTime; //时分秒 |
| | | public void setTestTime(ByteBuffer bf) { |
| | | if(bf.limit() < BYTE_LEN) { |
| | | return; |
| | |
| | | this.hour = ComBase.changeByteToInt(bf.get()); |
| | | this.minute = ComBase.changeByteToInt(bf.get()); |
| | | this.second = ComBase.changeByteToInt(bf.get()); |
| | | this.testTime=""; |
| | | if(this.hour<10){ |
| | | this.testTime=this.testTime+"0"+this.hour; |
| | | }else { |
| | | this.testTime=this.testTime+this.hour; |
| | | } |
| | | if(this.minute<10){ |
| | | this.testTime=this.testTime+":"+"0"+this.minute; |
| | | }else { |
| | | this.testTime=this.testTime+":"+this.minute; |
| | | } |
| | | if(this.second<10){ |
| | | this.testTime=this.testTime+":"+"0"+this.second; |
| | | }else { |
| | | this.testTime=this.testTime+":"+this.second; |
| | | } |
| | | } |
| | | } |