C ++ 11 days from the date

I need to save the date in a flat file. Is there any simple method to get the number of days from a specific date (e.g., from 1 AD) using the standard library in C ++ 11? The only thing I know is:

  • get std :: tm structure, set all time values ​​to 0
  • convert it to std :: time_t (I don't know a suitable method yet)
  • split time_t to get one day resolution.

Can I make it easier?

+3
source share
1 answer

, , . struct tm time_t, mktime. , mktime /, UTC, , "" , , , .

+2

All Articles