-
Notifications
You must be signed in to change notification settings - Fork 58
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
localtime function and DST #132
Comments
@andy3469 looks like MS Windows issue. Can you do |
I just changed all the IPs and url to another thing because of security Also for your information, I tested the connection with DST and the python SDK and it's working correctly. Only the C++ SDK is not working correctly. |
Wow, topical. I just fought through this on macOS last night. This fixed it: diff --git a/src/utils.cc b/src/utils.cc
index 5204547..f3418be 100644
--- a/src/utils.cc
+++ b/src/utils.cc
@@ -337,7 +337,9 @@ UtcTime UtcTime::Now() {
auto usec_now = std::chrono::system_clock::now().time_since_epoch() /
std::chrono::microseconds(1);
auto secs_local = static_cast<time_t>(usec_now / 1000000);
- auto secs_utc = std::mktime(std::gmtime(&secs_local));
+ auto tm_time = std::gmtime(&secs_local);
+ tm_time->tm_isdst = - 1;
+ auto secs_utc = std::mktime(tm_time);
return UtcTime(secs_utc, static_cast<long>(usec_now % 1000000));
} The issue, as they mention here, is that the I set it to Admittedly, it's not clear exactly how |
Fixes minio#132 Signed-off-by: Bala.FA <[email protected]>
Fixes minio#132 Signed-off-by: Bala.FA <[email protected]>
Fixes minio#132 Signed-off-by: Bala.FA <[email protected]>
Yes the PR #133 fixes the issue correctly |
Fixes #132 Signed-off-by: Bala.FA <[email protected]>
There is a problem of RequestTimeTooSkewed when you try to connect to a server while the timezone is in DST mode.
When you add x-amx-date to the request header, the function localtime is called.
I know that all the communication are done in UTC as noted in the PR #115.
The thing is, when the PC is set in DST (daylight), localtime add 1 hour to the returned time.
If I disable DST, it's working correctly.
PS: I'm working on Windows
The text was updated successfully, but these errors were encountered: