From d8f882a27797a64b83e36241bf5b71de3beda3d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Soutad=C3=A9?= Date: Thu, 12 Aug 2021 21:11:40 +0200 Subject: [PATCH] Fix a bug : gmtime() should used in place of localtime() to keep date in UTC and not local timezone --- include/libgourou.h | 2 +- src/libgourou.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/libgourou.h b/include/libgourou.h index 1546e1c..5df9cfc 100644 --- a/include/libgourou.h +++ b/include/libgourou.h @@ -40,7 +40,7 @@ #define ACS_SERVER "http://adeactivate.adobe.com/adept" #endif -#define LIBGOUROU_VERSION "0.3.1" +#define LIBGOUROU_VERSION "0.3.2" namespace gourou { diff --git a/src/libgourou.cpp b/src/libgourou.cpp index 3843932..3aa21fc 100644 --- a/src/libgourou.cpp +++ b/src/libgourou.cpp @@ -291,7 +291,7 @@ namespace gourou appendTextElem(root, "adept:nonce", nonce.toBase64().data()); time_t _time = time(0) + 10*60; // Cur time + 10 minutes - struct tm* tm_info = localtime(&_time); + struct tm* tm_info = gmtime(&_time); char buffer[32]; strftime(buffer, sizeof(buffer), "%Y-%m-%dT%H:%M:%SZ", tm_info);