public static GregorianCalendar rawBytesToCalendar(byte[] value,boolean honorDeviceTimeOffset){
  if (value.length >= 7) {
    int year=toUint16(value[0],value[1]);
    GregorianCalendar timestamp=new GregorianCalendar(year,value[2],value[3],value[4],value[5],value[6]);
    if (honorDeviceTimeOffset) {
      int offsetInHours=MiBandCoordinator.getDeviceTimeOffsetHours();
      if (offsetInHours != 0) {
        timestamp.add(Calendar.HOUR_OF_DAY,-offsetInHours);
      }
    }
    return timestamp;
  }
  return createCalendar();
}

public static GregorianCalendar rawBytesToCalendar ( byte [ ] value , boolean honorDeviceTimeOffset ) { if ( value . length >= 7 ) { int year = toUint16 ( value [ 0 ] , value [ 1 ] ) ; GregorianCalendar timestamp = new GregorianCalendar ( year , value [ 2 ] , value [ 3 ] , value [ 4 ] , value [ 5 ] , value [ 6 ] ) ; if ( honorDeviceTimeOffset ) { int offsetInHours = MiBandCoordinator . getDeviceTimeOffsetHours ( ) ; if ( offsetInHours != 0 ) { timestamp . add ( Calendar . HOUR_OF_DAY , - offsetInHours ) ; } } return timestamp ; } return createCalendar ( ) ; }
uses the standard algorithm to convert bytes received from the miband to a calendar object
