Writing to the DS1371

This is my first uC project, so I'm perhaps missing something, but I can't seem to figure out how wo write to the 0x00-0x03 registers on the DS1371.

From reading the data sheet, it seems like this should work:

void time_set(long t){
  Wire.beginTransmission(104);
  Wire.write(0x0);  // control 0
  Wire.write(0x0);  // register 0
  Wire.write(t);
  Wire.endTransmission();
}

I'm either reading the data sheet incorrectly, or I'm missing something important on how Wire.write() works.

any hints?

I'm either reading the data sheet incorrectly, or I'm missing something important on how Wire.write() works.

For one thing, Wire.write() does not take a long. You either need to use the Wire.write() overload that takes an array, and treat the long as an array of (4) bytes, or you need to break the long into 4 bytes, and Wire.write() them in the proper order.