Skip to content

Commit 1aa97a9

Browse files
author
gojimmypi
committed
Correct Espressif default time setting
1 parent ecb8cb7 commit 1aa97a9

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

wolfcrypt/src/port/Espressif/esp_sdk_time_lib.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,10 +181,15 @@ int set_fixed_default_time(void)
181181
{
182182
/* ideally, we'd like to set time from network,
183183
* but let's set a default time, just in case */
184+
185+
ESP_LOGV(TAG, "Default Date %s", __DATE__);
186+
ESP_LOGV(TAG, "YEAR %d", YEAR);
187+
ESP_LOGV(TAG, "MONTH %d", MONTH);
188+
ESP_LOGV(TAG, "DAY %d", DAY);
184189
struct tm timeinfo = {
185-
.tm_year = YEAR,
186-
.tm_mon = MONTH, /* Month, where 0 = Jan */
187-
.tm_mday = DAY, /* Numeric decimal day of the month */
190+
.tm_year = YEAR - 1900, /* years since 1900 */
191+
.tm_mon = MONTH - 1, /* Month, where 0 = Jan */
192+
.tm_mday = DAY - 1, /* Numeric decimal day of the month */
188193
.tm_hour = 13,
189194
.tm_min = 1,
190195
.tm_sec = 5

0 commit comments

Comments
 (0)