1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-28 13:56:37 +02:00

api: add support of specifier %! for timestamp in function util_strftimeval

This commit is contained in:
Sébastien Helleu
2024-01-27 11:52:54 +01:00
parent 73a1c9753a
commit e3af6a91d4
8 changed files with 44 additions and 22 deletions
+8
View File
@@ -236,6 +236,14 @@ TEST(CoreUtil, Strftimeval)
LONGS_EQUAL(23, util_strftimeval (str_time, sizeof (str_time),
"%Y-%m-%d %H:%M:%S.%.7", &tv));
STRCMP_EQUAL("2023-12-25 10:29:09.%.7", str_time);
/* timestamp */
strcpy (str_time, "test");
LONGS_EQUAL(10, util_strftimeval (str_time, sizeof (str_time), "%!", &tv));
STRCMP_EQUAL("1703500149", str_time);
strcpy (str_time, "test");
LONGS_EQUAL(17, util_strftimeval (str_time, sizeof (str_time), "%!.%f", &tv));
STRCMP_EQUAL("1703500149.456789", str_time);
}
/*