I have searched all over Google without success for a way to convert my list of year,month,day and time to unix time. I need a simple way to find out if one time is smaller or bigger than another day. I have found this solution. I have this suggestion and want to know if there are any smarter or better way. It seems to work. I need the decimal seconds.
using namespace System;
int MyYear = 2017;
int MyMonth = 5;
int MyDay = 12;
int MyHour = 8;
int MyMinute = 33;
double MySecond =47.2332;
double whole, fractional;
fractional = std::modf(MySecond, &whole);
System::DateTimeOffset dto(MyYear, MyMonth, MyDay,
MyHour, MyMinute,static_cast<int>(whole),System::TimeSpan::Zero);
std::cout << "dto: Unix Seconds: " << dto.ToUnixTimeSeconds() << endl;
double MyUnixTime = static_cast<int>(dto.ToUnixTimeSeconds()) + fractional;
cout.precision(20);
std::cout << "MyUnixTime: " << MyUnixTime << endl;