I would not be so bold as to put an upper bound on the number of ways to
do what you ask.
However, a couple of simple ways you might want to consider include:
* Use the DateTime.AddSeconds() method to add the negative of the
seconds property to the instance, which will set the seconds to zero
* Use one of the many constructors that exist for the DateTime
structure that include the seconds, copying all of the fields from an
initialized copy of DateTime.UtcNow except for the seconds field, which
you'll set to 0.
I don't doubt that there are many other alternatives, most of which are
probably a lot more complicated than the above.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.