Skip to content
New issue

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

[Question] Why are there two adjacent space characters (0x20) in the what() message of ambiguous_local_time? #782

Closed
JMazurkiewicz opened this issue Apr 12, 2023 · 3 comments

Comments

@JMazurkiewicz
Copy link

Repro:

#include <chrono>
#include <date/tz.h>
#include <iostream>

int main() {
  using namespace date;
  using namespace std::chrono_literals;
  try {
    auto zt = zoned_time{"America/New_York",
                         local_days{Sunday[1] / November / 2016} + 1h + 30min};
  } catch (const ambiguous_local_time &e) {
    std::cout << e.what() << '\n';
  }
}

Result:

$ g++ main.cpp -std=c++20 -I../include ../build/libdate-tz.a
$ ./a.out
2016-11-06 01:30:00 is ambiguous.  It could be
2016-11-06 01:30:00 EDT == 2016-11-06 05:30:00 UTC or
2016-11-06 01:30:00 EST == 2016-11-06 06:30:00 UTC

Why are there two space characters between "ambiguous." and "It could"? Is there any reason or is it just a typo?

If it is a typo:

@JMazurkiewicz JMazurkiewicz changed the title [Question] Why are there two adjacent space characters (0x20) in the what() message of ambiguous_local_time [Question] Why are there two adjacent space characters (0x20) in the what() message of ambiguous_local_time? Apr 12, 2023
@HowardHinnant
Copy link
Owner

Blame it on my 2nd grade teacher ... and this: https://www.gocomics.com/bloom-county/2015/10/04

@jleffler
Copy link

jleffler commented Apr 12, 2023 via email

@JMazurkiewicz
Copy link
Author

Thanks for explanation, to be honest I've never seen two spaces separating sentences (only one).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants