Find the difference between two dates in hours?

前端 未结 3 623
长情又很酷
长情又很酷 2021-01-28 13:55

For example I can calculate the difference of these two dates by looking at them but i have no clue when it comes to calculating this in a program.

Dates: A is 201

3条回答
  •  难免孤独
    2021-01-28 14:38

    You may use difftime() to calculate difference between two times in C. However it uses mktime and tm.

    double difftime(time_t time1, time_t time0);
    

提交回复
热议问题