Skip to content
Permalink
Browse files

Add time zone qualifiers

  • Loading branch information
alandekok committed Aug 21, 2019
1 parent cda3f7a commit 1c56af306c0bbc985396003c80c0ec42b03c43c4
Showing with 15 additions and 0 deletions.
  1. +15 −0 src/lib/util/value.c
@@ -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) {

0 comments on commit 1c56af3

Please sign in to comment.
You can’t perform that action at this time.