Boost logo

Boost Users :

Subject: Re: [Boost-users] [Boost_users][date_time] Updating ptime after it's been constructed
From: Igor R (boost.lists_at_[hidden])
Date: 2008-09-10 09:42:28


You can assign a new ptime:
ptime p = microsec_clock::local_time();
//.... some code
p = microsec_clock::local_time();

Or, if you use any ptr to ptime:
*p = ....;

2008/9/10 Ryan McConnehey <mccorywork_at_[hidden]>:
> Hi,
>
> Currently I'm creating a boost date_time object as follows:
>
> boost::shared_ptr<boost::posix_time::ptime> time(new
> boost::posix_time::ptime(boost::posix_time::microsec_clock::local_time()));
>
> Now that the ptime object has been created how do I update the boost pointer
> with a new local_time? There doesn't seem to be any function calls or
> operators that allow the setting of time. The only operators seem to allow
> you to offset the time not replace it.
>
> Ryan
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net