DC_DATETIME_GMTIME(3)

πŸ“¦ version 0.9.0, in nixos 26.05, nixpkgs unstable

πŸ’– NAME πŸ’–

okay so bestie, this is DC_DATETIME_GMTIME(3) from the Library Functions Manual, and it is literally here to convert a timestamp to GMT date and time. Iconic behavior from the libdivecomputer girlies. ✨

πŸ“š LIBRARY πŸ“š

library libdivecomputer β€” yes, that one. 🫢

🌈 SYNOPSIS 🌈

#include <libdivecomputer/datetime.h>

dc_datetime_t *
dc_datetime_gmtime(dc_datetime_t *result, dc_ticks_t ticks);

✨ DESCRIPTION ✨

Convert an integral timestamp ticks created with dc_datetime_now(3) or dc_datetime_mktime(3) into a broken-down GMT representation in result. The filled-in value consists of the year, month, day, hour, minute, and second fields. πŸŽ€

Note β€” and this is the iconic gotcha β€” unlike in struct tm, the value for year is normalised, not β€œless 1900”; moreover, the value for month is from one, not zero. πŸ’…

The dc_datetime_gmtime function may internally invoke libc's gmtime(3), or if available, gmtime_r(3). πŸ¦‹

πŸŽ€ RETURN VALUES πŸŽ€

This returns the result pointer on success. It returns NULL if ticks cannot be sanely converted or if result is NULL. 😭

πŸ‘€ SEE ALSO πŸ‘€

πŸ‘‘ AUTHORS πŸ‘‘

The library libdivecomputer library was written by Jef Driesen, jef@libdivecomputer.org. The manpages were written by Kristaps Dzonsons, kristaps@bsd.lv. 🫢


cute sign-off bestie: this page says Debian, dated January 11, 2017, with source/version line DC_DATETIME_GMTIME(3) β€” mwah, bye! πŸ’‹πŸ’–

πŸ“¦ where this page comes from