code: private void writeTimeStamp(byte[] buffer, int offset, long time) {
          long seconds = time / 1000L;
          long milliseconds = time - seconds * 1000L;
          seconds += OFFSET_1900_TO_1970;
  
          // write seconds in big endian format
          buffer[offset++] = (byte) (seconds >> 24);
          buffer[offset++] = (byte) (seconds >> 16);
          buffer[offset++] = (byte) (seconds >> 8);
          buffer[offset++] = (byte) (seconds >> 0);
  
          long fraction = milliseconds * 0x100000000L / 1000L;
          // write fraction in big endian format
          buffer[offset++] = (byte) (fraction >> 24);
          buffer[offset++] = (byte) (fraction >> 16);
          buffer[offset++] = (byte) (fraction >> 8);
          // low order bits should be random data
          buffer[offset++] = (byte) (Math.random() * 255.0);
      }
docs: Writes system time (milliseconds since January 1, 1970) as an NTP time stamp
  at the given offset in the buffer.