summaryrefslogtreecommitdiff
path: root/doc/en
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2024-01-05 19:04:27 +0100
committerSébastien Helleu <flashcode@flashtux.org>2024-01-05 19:09:19 +0100
commitf6ba789c3d33bdc1bcc6c00e9660ffbd9f2ba514 (patch)
tree3b1a78e26a482a306df8515d8a4385a095221037 /doc/en
parente88882f0ae031c2c3400a517b751c53a66b1c79f (diff)
downloadweechat-f6ba789c3d33bdc1bcc6c00e9660ffbd9f2ba514.zip
api: add function util_parse_time (issue #649)
Diffstat (limited to 'doc/en')
-rw-r--r--doc/en/weechat_plugin_api.en.adoc34
1 files changed, 34 insertions, 0 deletions
diff --git a/doc/en/weechat_plugin_api.en.adoc b/doc/en/weechat_plugin_api.en.adoc
index 403f9b8d6..70f1dd3eb 100644
--- a/doc/en/weechat_plugin_api.en.adoc
+++ b/doc/en/weechat_plugin_api.en.adoc
@@ -4737,6 +4737,40 @@ weechat_util_strftimeval (time, sizeof (time), "%FT%T.%f", &tv);
[NOTE]
This function is not available in scripting API.
+==== util_parse_time
+
+_WeeChat ≥ 4.2.0._
+
+Parse date/time with support of microseconds.
+
+Prototype:
+
+[source,c]
+----
+int util_parse_time (const char *datetime, struct timeval *tv);
+----
+
+Arguments:
+
+* _date_: date/time
+* _tv_: parsed date/time ("timeval" structure)
+
+Return value:
+
+* 1 if OK, 0 if error
+
+C example:
+
+[source,c]
+----
+struct timeval tv;
+weechat_util_parse_time ("2023-12-25T10:29:09.456789Z", &tv); /* == 1 */
+/* result: tv.tv_sec == 1703500149, tv.tv_usec = 456789 */
+----
+
+[NOTE]
+This function is not available in scripting API.
+
==== util_version_number
_WeeChat ≥ 0.3.9._