Adjusting DateTime values

I am using DateTime.UtcNow to get local time on a clock.
It is working fine.
Although I want to have other clocks in the room that are not the same time.
By that I only mean 5 minutes ahead and 5 minutes behind.

I can’t quite get my head around the correct math for my code.
And I have a feeling it is going to be a very simple solution.
Of course when real time is at 55 minutes and I make it 60 the next minute will have
to change the hour right. Eventually that gets messy. Same issue with being 5 minutes
behind.
Any suggestions? Thanks in advance.

1 Answer

1

Got it.
var minutes = System.DateTime.Now.AddMinutes(5).Minute;
And for making the clock 5 minutes behind
var minutes = System.DateTime.Now.AddMinutes(-5).Minute;