How to get current time and date in C++?

后端 未结 24 2120
刺人心
刺人心 2020-11-22 06:55

Is there a cross-platform way to get the current date and time in C++?

24条回答
  •  佛祖请我去吃肉
    2020-11-22 07:41

    (For fellow googlers)

    There is also Boost::date_time :

    #include 
    
    boost::posix_time::ptime date_time = boost::posix_time::microsec_clock::universal_time();
    

提交回复
热议问题