Why isnt this code working?

Wrote a simple code to act as a timer. Can anyone tell me why this isnt working as expected?

int s = 0;
int m = 0;
int h = 0;
int d = 0;

void setup() {
  Serial.begin(9600);
}

void loop() {
  ++s;
  delay(1000);

  if (s = 60) {
    s = 0;
    ++m;
  }

  if (m = 60) {
    m = 0;
    ++h;
  }

  if (h = 24) {
    h = 0;
    ++d;
  }

  Serial.print(d);
  Serial.print(":");
  Serial.print(h);
  Serial.print(":");
  Serial.print(m);
  Serial.print(":");
  Serial.println(s);
}

= is for assignment,

== is for comparison

Can anyone tell me why this isnt working as expected?

Aside from the issue that guix pointed out, how are we supposed to know what the code is doing? How are we supposed to know what you expect? The answer to your question is no. No one can point out why the code is not doing what you expect, because we don't know what you expect.

He could have explained the symptoms, which, because of the error already pointed out, I guess left seconds, minutes and hours at 0 and wildly incremented the day counter.