Skip to content

Commit

Permalink
Add time zone qualifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
alandekok committed Aug 21, 2019
1 parent cda3f7a commit 1c56af3
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/lib/util/value.c
Original file line number Diff line number Diff line change
Expand Up @@ -4809,6 +4809,21 @@ size_t fr_value_box_snprint(char *out, size_t outlen, fr_value_box_t const *data
len += snprintf(buf + len, sizeof(buf) - len - 1, "%09" PRIi64, subseconds);
break;
}

/*
* And time zone.
*/
if (s_tm.tm_gmtoff != 0) {
int hours, minutes;

hours = s_tm.tm_gmtoff / 3600;
minutes = (s_tm.tm_gmtoff / 60) % 60;

len += snprintf(buf + len, sizeof(buf) - len - 1, "%+03d:%02u", hours, minutes);
} else {
buf[len] = 'Z';
len++;
}
}

if (quote > 0) {
Expand Down

0 comments on commit 1c56af3

Please sign in to comment.