Problems With .rotate behavior

Hey, I’m trying to make a day & night cycle. In order to do this I used .rotate.x. The problem is that the rotation goes from 0 to 90, then it starts decreasing to 0. Then It goes from 360 to 270 and then back to 360 and 0. It rotates as I want but to program is very complex. If there is a way to rotate from 0 to 360 and then 0 again it will be much easier to program. It is possible to do this?

Code:
sun.transform.rotate = new Vector3(secs,0,0);

transform.rotation is a Quaternion. It won’t work the way you would expect if you assign Vector3-s to it.
If you want to rotate it like that you have a few options though:

transform.Rotate(new Vector3(secs,0,0));
// or
transform.eulerAngles = new Vector3(secs,0,0);
// or
transform.rotation = Quaternion.Euler(new Vector3(secs,0,0));