"timezone" from time.h may be updated when localtime() is called, and therefore, the timezone value should only be used after the call to localtime() which is called in our Update_Current_Time() function. Thanks, Piotr!
This commit is contained in:
@@ -531,6 +531,8 @@ int tm_isdst Daylight Savings flag.
|
|||||||
} else {
|
} else {
|
||||||
Daylight_Savings_Status = false;
|
Daylight_Savings_Status = false;
|
||||||
}
|
}
|
||||||
|
/* note: timezone is declared in <time.h> stdlib. */
|
||||||
|
UTC_Offset = timezone/60;
|
||||||
} else {
|
} else {
|
||||||
datetime_date_wildcard_set(&Local_Date);
|
datetime_date_wildcard_set(&Local_Date);
|
||||||
datetime_time_wildcard_set(&Local_Time);
|
datetime_time_wildcard_set(&Local_Time);
|
||||||
@@ -615,8 +617,7 @@ int Device_Encode_Property_APDU(
|
|||||||
apdu_len = encode_application_time(&apdu[0], &Local_Time);
|
apdu_len = encode_application_time(&apdu[0], &Local_Time);
|
||||||
break;
|
break;
|
||||||
case PROP_UTC_OFFSET:
|
case PROP_UTC_OFFSET:
|
||||||
/* note: timezone is declared in <time.h> stdlib. */
|
Update_Current_Time();
|
||||||
UTC_Offset = timezone/60;
|
|
||||||
apdu_len = encode_application_signed(&apdu[0], UTC_Offset);
|
apdu_len = encode_application_signed(&apdu[0], UTC_Offset);
|
||||||
break;
|
break;
|
||||||
case PROP_LOCAL_DATE:
|
case PROP_LOCAL_DATE:
|
||||||
|
|||||||
Reference in New Issue
Block a user