Skip to content

Commit

Permalink
remove tz offset calculation on UTC timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
nachdenksport committed Aug 12, 2022
1 parent 8e42393 commit e4e2bd7
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/rfc3339.c
Original file line number Diff line number Diff line change
Expand Up @@ -427,14 +427,6 @@ static void _local_timestamp_to_date_time(double timestamp, date_time_struct *no
struct tm *ts = NULL;
ts = localtime(&t);

int offset;
#ifdef HAVE_STRUCT_TM_TM_ZONE
// tm_gmtoff requires POSIX
offset = (int)(*ts).tm_gmtoff / HOUR_IN_MINS;
#else
offset = 0;
#endif

(*now).date.year = (*ts).tm_year + 1900;
(*now).date.month = (*ts).tm_mon + 1;
(*now).date.day = (*ts).tm_mday;
Expand All @@ -445,7 +437,7 @@ static void _local_timestamp_to_date_time(double timestamp, date_time_struct *no
(*now).time.minute = (*ts).tm_min;
(*now).time.second = (*ts).tm_sec;
(*now).time.fraction = (int)usec; // sec fractions in microseconds
(*now).time.offset = offset;
(*now).time.offset = 0;
(*now).time.ok = 1;

(*now).ok = 1;
Expand Down

0 comments on commit e4e2bd7

Please sign in to comment.