diff options
Diffstat (limited to 'src/json/json_pack.c')
-rw-r--r-- | src/json/json_pack.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/json/json_pack.c b/src/json/json_pack.c index 7a5d22ee2..1859e264a 100644 --- a/src/json/json_pack.c +++ b/src/json/json_pack.c | |||
@@ -36,6 +36,20 @@ TALER_JSON_pack_time_abs (const char *name, | |||
36 | 36 | ||
37 | 37 | ||
38 | struct GNUNET_JSON_PackSpec | 38 | struct GNUNET_JSON_PackSpec |
39 | TALER_JSON_pack_time_abs_human (const char *name, | ||
40 | struct GNUNET_TIME_Absolute at) | ||
41 | { | ||
42 | struct GNUNET_JSON_PackSpec ps = { | ||
43 | .field_name = name, | ||
44 | .object = json_string ( | ||
45 | GNUNET_STRINGS_absolute_time_to_string (at)) | ||
46 | }; | ||
47 | |||
48 | return ps; | ||
49 | } | ||
50 | |||
51 | |||
52 | struct GNUNET_JSON_PackSpec | ||
39 | TALER_JSON_pack_time_abs_nbo (const char *name, | 53 | TALER_JSON_pack_time_abs_nbo (const char *name, |
40 | struct GNUNET_TIME_AbsoluteNBO at) | 54 | struct GNUNET_TIME_AbsoluteNBO at) |
41 | { | 55 | { |
@@ -45,6 +59,15 @@ TALER_JSON_pack_time_abs_nbo (const char *name, | |||
45 | 59 | ||
46 | 60 | ||
47 | struct GNUNET_JSON_PackSpec | 61 | struct GNUNET_JSON_PackSpec |
62 | TALER_JSON_pack_time_abs_nbo_human (const char *name, | ||
63 | struct GNUNET_TIME_AbsoluteNBO at) | ||
64 | { | ||
65 | return TALER_JSON_pack_time_abs_human (name, | ||
66 | GNUNET_TIME_absolute_ntoh (at)); | ||
67 | } | ||
68 | |||
69 | |||
70 | struct GNUNET_JSON_PackSpec | ||
48 | TALER_JSON_pack_time_rel (const char *name, | 71 | TALER_JSON_pack_time_rel (const char *name, |
49 | struct GNUNET_TIME_Relative rt) | 72 | struct GNUNET_TIME_Relative rt) |
50 | { | 73 | { |