jeudi 30 novembre 2017

Extract day and time from Howard Hinnant's date library

I am using Howard Hinnant's free, open-source, cross-platform, C++11/14 timezone library:

#include "date/tz.h"
#include <iostream>

int
main()
{
    std::cout << date::make_zoned("Europe/Rome", std::chrono::system_clock::now()) << '\n';
}

And I am getting an output like this:

2017-11-29 16:24:32.710766 CET

Is it possible from zoned_time to extract the day (for example: Monday) and the HH:MM in diffent strings? Can the zoned_time be converted to struct tm?

Aucun commentaire:

Enregistrer un commentaire