, , , - , API C, , . .
. - :
#include "date.h"
#include <iostream>
int
main()
{
using namespace date;
std::cout << std::chrono::system_clock::now() << '\n';
}
:
2017-09-15 13:11:34.356648
using namespace date;, system_clock::time_point ( namespace std::chrono). : system_clock::time_point (microseconds, macOS).
strftime - , , . , :
#include "date.h"
#include <iostream>
int
main()
{
using namespace date;
using namespace std::chrono;
std::cout << format("%D %T %Z\n", floor<milliseconds>(system_clock::now()));
}
:
09/15/17 13:17:40.466 UTC