scan_iso8601(3)

omg hi bestie! πŸ’– you're on the scan_iso8601(3) page from the Library Functions Manual, and we are about to parse some ISO-8601 timestamps. it's giving timezone chaos, but make it cute. ✨


πŸŽ€ NAME πŸŽ€

scan_iso8601 β€” parse an ISO-8601 timestamp. periodt. πŸ’…


🌸 SYNTAX 🌸

#include <libowfat/scan.h>

size_t scan_iso8601(const char *src,struct timespec *dest);

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so scan_iso8601 parses a timestamp as defined in ISO-8601 into a struct timespec. it returns the number of bytes read from src β€” and if the parse errors out? it returns 0. not a vibe, but at least you know. 😭

scan_iso8601 supports input timestamps in time zones other than UTC even though fmt_iso8601 does not. yes bestie, scan is the flexible one here. πŸ’…

note, and this is important: the returned time_t is always in UTC, even if a local time was given. UTC only. no cap. πŸ’€

🌈 SEE ALSO 🌈


bye bestie! 🫢 the footer just says scan_iso8601(3) β€” that's the source/version/date tea we got, and it's iconic. πŸ’–βœ¨