aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_strings_lib.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/gnunet_strings_lib.h')
-rw-r--r--src/include/gnunet_strings_lib.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/include/gnunet_strings_lib.h b/src/include/gnunet_strings_lib.h
index 2e0c720ee..6c91edd05 100644
--- a/src/include/gnunet_strings_lib.h
+++ b/src/include/gnunet_strings_lib.h
@@ -95,6 +95,20 @@ enum GNUNET_GenericReturnValue
95GNUNET_STRINGS_fancy_time_to_absolute (const char *fancy_time, 95GNUNET_STRINGS_fancy_time_to_absolute (const char *fancy_time,
96 struct GNUNET_TIME_Absolute *atime); 96 struct GNUNET_TIME_Absolute *atime);
97 97
98/**
99 * @ingroup time
100 * Convert a given RFC3339 time to our internal
101 * representation.
102 *
103 * @param rfc3339_time human readable string (e.g. %Y-%m-%dT%H:%M:%SZ)
104 * @param atime set to the absolute time
105 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
106 */
107enum GNUNET_GenericReturnValue
108GNUNET_STRINGS_rfc3339_time_to_absolute (const char *rfc3339_time,
109 struct GNUNET_TIME_Absolute *atime);
110
111
98 112
99/** 113/**
100 * @ingroup time 114 * @ingroup time
@@ -270,6 +284,21 @@ GNUNET_STRINGS_absolute_time_to_string (struct GNUNET_TIME_Absolute t);
270 284
271/** 285/**
272 * @ingroup time 286 * @ingroup time
287 * Like `asctime`, except for GNUnet time. Converts a GNUnet internal
288 * absolute time (which is in UTC) to a string in local time according to
289 * RFC3339.
290 * Note that the returned value will be overwritten if this function
291 * is called again.
292 *
293 * @param t the absolute time to convert
294 * @return timestamp in human-readable form in local time (RFC3339)
295 */
296const char *
297GNUNET_STRINGS_absolute_time_to_rfc3339 (struct GNUNET_TIME_Absolute t);
298
299
300/**
301 * @ingroup time
273 * Give relative time in human-readable fancy format. 302 * Give relative time in human-readable fancy format.
274 * This is one of the very few calls in the entire API that is 303 * This is one of the very few calls in the entire API that is
275 * NOT reentrant! 304 * NOT reentrant!