find how many seconds past since 1/1/1970

后端 未结 3 1618
栀梦
栀梦 2021-02-19 06:14

I am looking for a function in C++ that calculates how many seconds have past from 1/1/1970 until today.

3条回答
  •  深忆病人
    2021-02-19 06:48

    #include 
    
    time_t seconds_past_epoch = time(0);
    

    Available on most operating systems.

提交回复
热议问题