We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ptime
When the time type is boost::posix_time::ptime, Boost.DateTime output facets don't produce any output for "%Z", "%z", "%Q" and "%q" flags.
boost::posix_time::ptime
Here is an example:
#include <ctime> #include <iostream> #include <locale> #include <boost/date_time.hpp> static const char format[] = "%Y-%m-%d %H:%M:%S %z"; int main() { auto *facet = new boost::posix_time::time_facet(format); std::locale loc(std::locale(), facet); std::locale::global(loc); std::cout.imbue(loc); auto now = boost::posix_time::microsec_clock::local_time(); std::cout << '"' << now << '"' << std::endl; std::time_t time_t_now = boost::posix_time::to_time_t(now); std::tm tm_buf = {}; std::tm* tm_now = boost::date_time::c_time::localtime(&time_t_now, &tm_buf); char buf[128]; std::strftime(buf, sizeof(buf), format, tm_now); std::cout << '"' << buf << '"' << std::endl; }
Output:
"2023-07-02 17:36:16" "2023-07-02 20:36:16 +0300"
I would expect the time zone format flags to work and result in the current system time zone in the output.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
When the time type is
boost::posix_time::ptime
, Boost.DateTime output facets don't produce any output for "%Z", "%z", "%Q" and "%q" flags.Here is an example:
Output:
I would expect the time zone format flags to work and result in the current system time zone in the output.
The text was updated successfully, but these errors were encountered: