Boost logo

Boost Users :

From: Scott (cheesy4poofs_at_[hidden])
Date: 2006-05-04 08:17:33

I noticed there's a from_time_t() helper function, but I need to convert
from a ptime to a time_t. Is this the proper way to do it?

  std::time_t to_time_t(ptime t)
    ptime start(gregorian::date(1970,1,1));
    time_duration dur = t - start;
    return dur.seconds();

I'm also curious why such functionality isn't already available?


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at