How do I construct an ISO 8601 datetime in C++?

前端 未结 9 1239
小蘑菇
小蘑菇 2020-12-05 01:51

I\'m working with the Azure REST API and they are using this to create the request body for table storage:

DateTime.UtcNow.ToString(\"o\")

9条回答
  •  长情又很酷
    2020-12-05 02:22

    Did it like this:

    using namespace boost::posix_time;
    ptime t = microsec_clock::universal_time();
    qDebug() << QString::fromStdString(to_iso_extended_string(t) + "0Z"); // need 7 digits
    

提交回复
热议问题