Boost C++ Libraries of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.

Class ptime

boost::posix_time::ptime — Time type with no timezone or other adjustments.


// In header: <boost/date_time/posix_time/ptime.hpp>

class ptime : public date_time::base_time< ptime, posix_time_system > {
  // types
  typedef posix_time_system                    time_system_type;  
  typedef time_system_type::time_rep_type      time_rep_type;     
  typedef time_system_type::time_duration_type time_duration_type;
  typedef ptime                                time_type;         

  // construct/copy/destruct
  ptime(gregorian::date, time_duration_type);
  explicit ptime(gregorian::date);
  ptime(const time_rep_type &);
  ptime(const special_values);


ptime public construct/copy/destruct

  1. ptime(gregorian::date d, time_duration_type td);
    Construct with date and offset in day.
  2. explicit ptime(gregorian::date d);
    Construct a time at start of the given day (midnight)
  3. ptime(const time_rep_type & rhs);
    Copy from time_rep.
  4. ptime(const special_values sv);
    Construct from special value.
  5. ptime();