Re: [Cppcms-users] booster::locale::as::ftime(...) sometimes causes wrong result
Brought to you by:
artyom-beilis
|
From: <ele...@ex...> - 2013-06-17 09:47:43
|
Simple test:
#include <booster/locale.h>
#include <iostream>
#include <sstream>
using namespace booster::locale;
using namespace std;
int main()
{
generator gen;
std::locale::global(gen(""));
std::cout.imbue(std::locale());
string str1="2010-08-10";
string str2="10-08-2010";
istringstream is(str1);
date_time dt;
is >> as::ftime("%Y-%m-%d") >> dt;
cout << as::date << dt << endl;
istringstream is2(str2);
date_time dt2;
is2 >> as::ftime("%d-%m-%Y") >> dt2;
cout << as::date << dt2 << endl;
}
Prints:
[petr@petr-archlinux ~]$ ./a.out
10/08/2010
20/12/2009
|