void.pointer
void.pointer

Reputation: 26355

boost::gregorian::date with time?

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.

Upvotes: 4

Views: 1633

Answers (1)

sehe
sehe

Reputation: 393064

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

Upvotes: 3

Related Questions