vf_date_string_to_time(3)

πŸ“¦ version 1.13, in debian bookworm, ubuntu jammy, ubuntu noble

πŸ’– vf_date_string_to_time(3) πŸ’–

okay bestie, welcome to the Library Functions Manual, we're doing vf_date_string_to_time(3) today and honestly? it's a lil cutie. tiny function, big job: turning calendar strings into actual time. let's get into it ✨


✨ NAME ✨

vf_date_string_to_time β€” no cap, it's just vf_date_string_to_time(). the name ate and left no crumbs, the function is exactly what it says πŸ’…


🌸 SYNOPSIS 🌸

#include <../vformat/vf_iface.h>

extern bool_t vf_date_string_to_time
(
     uint32_t *p_time,
     const char *p_string
);

like look at her. two params, one header, zero drama πŸŽ€


πŸ¦‹ PARAMETERS πŸ¦‹

  • uint32_t *p_time β€” this is where the time comes OUT, bestie. it's the output time value. you hand her a pointer, she fills it in. that's the whole arrangement πŸ’œ
  • const char *p_string β€” the input string. the raw calendar-y text goes in here and gets turned into something real πŸ”₯

πŸ‘‘ DESCRIPTION πŸ‘‘

okay so the vibe here is: convert calendar string to absolute time. that's it. that's the whole mission. she takes your little string and gives you back actual time, periodt.

the basic formats are:

19960401, 19960401T073000Z

so like, a bare date works, and the fancy full version with the T and the Z works too. the T separates date from time, and that Z is doing its timezone thing. iconic behaviour honestly 🫢


⭐ RETURNS ⭐

  • TRUE <=> conversion OK
  • FALSE else

that <=> is the fancy math way of saying "if and only if", iykyk. so TRUE means the conversion went through, and FALSE means... it did not, and you should probably go check your string πŸ™ˆ


🌈 SEE ALSO 🌈

the whole friend group, fr fr β€” go say hi to all of them:


tiny little note before you go: this page was brought to you by c2man vf_iface.h, dated 30 April 2003 β€” a whole vintage moment, honestly. so old but still serving πŸ’– anyway, ily, go convert some dates, and don't forget to actually check that return value. bye bestie!! 🧚✨
πŸ“¦ where this page comes from