I've got the task to convert some C# code to C++ and I've problems with chrono. Goal is to round a time to a variable time span.
C#:
int iRoundTo = 30; // can be 45 or other variable value, not a const
DateTime dt = Floor(DateTime.Now, new TimeSpan(0, 0, 0, iRoundTo));
I found a solution with const iRoundTo but this is not what I'm looking for. How do I convert this to C++ with using std::chono?
C++:
std::chrono::seconds diff(iRoundTo);
auto dt = std::chrono::floor<diff>(Now);
This is not working due to compile error.
Thanks.