Boost logo

Boost Users :

From: Edwin Savarimuthu (zerobook_at_[hidden])
Date: 2007-11-02 10:48:00


Is this a boost question? If you want a boost solution take a look at
boost::posix_time
http://www.boost.org/doc/html/date_time/posix_time.html

To get the local time, the following worked well for me so far.
boost::posix_time::microsec_clock::local_time();

The following string conversion functions that comes with this library
satisfy most of the general use cases.
std::string to_simple_string(ptime)
std::string to_iso_string(ptime)
std::string to_iso_extended_string(ptime)

Thanks,
Edwin

On 10/31/07, Jeff <grahamspam_at_[hidden]> wrote:
> Hello,
>
> How can I grab the current local date and time, and format it so that it
> looks like this:
>
> YYYY_MMM_DD_HH_MM_SS ?
>
> I can't seem to get the facet stuff to work right.
>
> Thanks,
> Jeff
>
> _______________________________________________
> 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