
On 4/15/2011 12:33 PM, Noah Roberts wrote:
#include <boost/locale.hpp>
#include <iostream> //#include <ctime>
using namespace boost::locale;
int main() { generator gen; //std::locale::global(gen("snthsnth")); // no exception std::locale::global(gen("en_US.UTF-8"));
double now = time(0);
std::cout << "Today is " << as::date << now << std::endl << "Current time is " << as::time << now << std::endl << "The current weekday is " << as::ftime("%A") << now << std::endl;
std::cin.get(); }
http://cppcms.sourceforge.net/boost_locale/html/formatting_and_parsing.html
I get warnings about converting from time_t to double (which I rather expected) and then get basic, double formatted output:
Today is 1.3029e+009 Current time is 1.3029e+009 The current weekday is 1.3029e+009
Should note also when I use "auto now = time(0);" I get integer output, not formatted dates and times.