Open peterwilson136 opened 3 years ago
If you're using the latest VS, you no longer need this library. It is implemented in <chrono>
.
If you're using a version of VS that doesn't yet implement C++17 CTAD, then you'll need to explicitly supply the first template argument for zoned_time
, which is a duration
consistent with the second zoned_time
constructor argument, for example:
zoned_time<seconds> zt{ current_zone(), tpd + s };
For this particular example (seconds-precision), there also exists a convenience type alias that you could use:
zoned_seconds zt{ current_zone(), tpd + s };
Ah yes, that fixes it, code compiles. If its alright, to extend this a little, the code crashes with dates such as "2000-01-01"
2000-01-01 00:00:00
at this line in tz.cpp
if (!file_exists(install))
{
std::string msg = "Timezone database not found at \"";
msg += install;
msg += "\"";
throw std::runtime_error(msg);
}
and I have tried even replacing current_zone()
with
auto tz = locate_zone("Australia/Sydney");
but it still crashes at the same place.
You will need to follow these installation instructions: https://howardhinnant.github.io/date/tz.html#Installation, including the section marked "Windows specific:".
Hi, I am trying to compile with
tz.cpp
for the below code, and I am getting quite a lot of error messages. I have CURL linked and included in the project, as well as some steps in the installation included, i.e.#define NOMINMAX
.tz.cpp
is included in my source files, and the directory to the header files is part of the project too. The error messages I get are: