如何計算C中的兩個日期(任何庫等)之間的時間段?使用C計算時間段C
程序應該將兩個(本地)日期作爲輸入,並提供它們之間的持續時間作爲輸出。
例如,
startDate = OCT-09-1976 and endDate = OCT-09-2008
should show a duration of 32 years.
startDate = OCT-09-1976 and endDate = DEC-09-2008
should show a duration of 32 years and 2 months.
感謝。
請注意,您鏈接的示例只是通過執行天和年來計算月份的問題。 – 2008-11-29 16:04:32