Boost logo

Boost Users :

Subject: [Boost-users] using AM and PM with boost::posix_time newbie
From: Adam Zedan (zedan185_at_[hidden])
Date: 2011-09-23 12:55:29


the following code works properly
std::string ts("2002-01-20 10:27:30");
boost::posix_time::ptime t(boost::posix_time::time_from_string(ts));
std::cout << t.time_of_day() << "\n";

1)
Now i want to actually change the string to
std::string ts("2002-01-20 10:27:30 AM");
but that wont work ??
Why any suggestions would be appreciated??

2)
also to display time i am using
boost::posix_time::ptime pc(boost::posix_time::second_clock::local_time());
        std::cout << pc.time_of_day() << "\n"; //output is 10:55:30
how could i make it display am/pm in the output ??



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