File: demo.cc

package info (click to toggle)
c%2B%2B-annotations 13.02.02-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 13,576 kB
  • sloc: cpp: 25,297; makefile: 1,523; ansic: 165; sh: 126; perl: 90; fortran: 27
file content (55 lines) | stat: -rw-r--r-- 1,513 bytes parent folder | download | duplicates (2)
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';

}