【问题标题】:Is there any way to get precision time from __time32_t in c++?有什么方法可以从 C++ 中的 __time32_t 获取精确时间?
【发布时间】:2022-12-12 18:34:46
【问题描述】:

我有一个服务器,它在 __time32_t 格式中返回时间 我想从 __time32_t 中获取毫秒格式的时间。可能吗?

localtime_s(&ptm, &close_time);
        std::wcsftime(buffer, 32, U("%Y.%m.%d %H:%M:%S"), &ptm);
        result[U("close_time")] = web::json::value::string(buffer);

【问题讨论】:

  • 可能,也可能不会。这取决于实施。 Related

标签: c++ time stl


【解决方案1】:

__time32_t 只包含秒,不包含毫秒。 https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/time-time32-time64?view=msvc-170

所以不,这是不可能的

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2022-06-15
    • 2020-07-02
    • 2020-04-11
    • 2018-04-21
    • 1970-01-01
    • 1970-01-01
    • 2013-03-07
    • 1970-01-01
    相关资源
    最近更新 更多