Checking How Many Minutes Have Passed This Day?

Morning folks, wondering if I could get a little general C# help, just trying to figure out how I could record the total minutes past in the current real day. I can work out how to call the current minute in the hour from the system time, but I’m not sure how I would calculate the whole day so far.

		GUI.Label (new Rect(90,90,200,90), System.DateTime.Now.TimeOfDay.Minutes.ToString());

Thats my method of getting the current minutes in a label, but I can’t figure out how to record the whole day so far. If anyone can give me hints it would be appreciated :slight_smile:

I think you just have to change System.DateTime.Now.TimeOfDay.Seconds.ToString() to System.DateTime.Now.TimeOfDay.Minutes.ToString() - according to this doc, TimeOfDay represents the time elapsed since midnight, and can be read as minutes as well (it’s a TimeSpan structure).

EDITED: Well, a brute force approach would be to calculate this using hours and minutes:

DateTime now = System.DateTime.Now;
int mins = now.Hour*60+now.Minute;
GUI.Label(...,  mins.ToString());

NOTE: I’m a JS guy, thus the code above may have some rubbish!