1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
|
#include <iostream>
#include <filesystem>
#include <chrono>
#include <bobcat/exception>
using namespace std;
using namespace chrono;
using namespace filesystem;
using namespace FBB;
int main(int argc, char **argv)
try
{
error_code ec;
// comment out the 2nd clock_time_conversion template and you get the
// first:
time_t seconds = system_clock::to_time_t(
clock_time_conversion<system_clock, system_clock>{}(
system_clock::now()
)
);
auto syspoint = system_clock::now();
auto filepoint = clock_time_conversion<file_clock, system_clock>
(syspoint);
// cout << syspoint.count() << '\n' <<
// filepoint.count() << '\n';
return 0;
cout << put_time(localtime(&seconds), "%c") << '\n';
auto sysTime = file_clock::to_sys(file_clock::now());
time_t sysSecs = system_clock::to_time_t(sysTime);
cout << put_time(localtime(&sysSecs), "%c") << '\n';
// seconds = system_clock::to_time_t(
// clock_time_conversion<system_clock, file_clock>{}(
// file_clock::now()
// )
// );
//
// cout << put_time(localtime(&seconds), "%c") << '\n';
}
catch (exception const &exc)
{
cout << exc.what() << '\n';
}
|