4

So far it looks like boost::gregorian::date only has day/month/year. I need to also store hour/minute/second. Can this object handle both? I'm having difficulty understanding how to represent all of this data.

void.pointer
  • 24,859
  • 31
  • 132
  • 243

1 Answers1

3

No, this object cannot handle that (because then boost::gregorian::date wouldn't be a ... date).

If you need a datetime, use boost::posix_time::ptime (which is a tuple of gregorian::date, time_duration).

If you also need a timezone look at boost::local_time::local_date_time or Boost Locale's date_time

sehe
  • 374,641
  • 47
  • 450
  • 633