libcdatetime(3)

πŸ“¦ in opensuse-leap 16.0

πŸ’… NAME πŸ’…

okay so libcdatetime.h β€” the header for a library that's here to support cross-platform C date and time functions. like, dates and times that work on every platform?? mother behavior honestly ✨


πŸŽ€ SYNOPSIS πŸŽ€

bestie. first you gotta let it in:

#include <libcdatetime.h>

and then these are all the functions you get. i grouped them by vibe so it's not just a wall of text, iykyk 🫢

πŸ¦‹ Support functions

const char *
libcdatetime_get_version(void);

🌸 Error functions

void
libcdatetime_error_free(libcdatetime_error_t **error);

int
libcdatetime_error_fprint(libcdatetime_error_t *error, FILE *stream);

int
libcdatetime_error_sprint(libcdatetime_error_t *error, char *string,
    size_t size);

int
libcdatetime_error_backtrace_fprint(libcdatetime_error_t *error,
    FILE *stream);

int
libcdatetime_error_backtrace_sprint(libcdatetime_error_t *error,
    char *string, size_t size);

🧚 Date and time elements functions

int
libcdatetime_elements_initialize(libcdatetime_elements_t **elements,
    libcdatetime_error_t **error);

int
libcdatetime_elements_free(libcdatetime_elements_t **elements,
    libcdatetime_error_t **error);

int
libcdatetime_elements_copy(libcdatetime_elements_t *destination_elements,
    const libcdatetime_elements_t *source_elements,
    libcdatetime_error_t **error);

int
libcdatetime_elements_get_year(libcdatetime_elements_t *elements,
    uint16_t *year, libcdatetime_error_t **error);

int
libcdatetime_elements_get_day_of_year(libcdatetime_elements_t *elements,
    uint16_t *day_of_year, libcdatetime_error_t **error);

int
libcdatetime_elements_get_month(libcdatetime_elements_t *elements,
    uint8_t *month, libcdatetime_error_t **error);

int
libcdatetime_elements_get_day_of_month(libcdatetime_elements_t *elements,
    uint8_t *day_of_month, libcdatetime_error_t **error);

int
libcdatetime_elements_get_date_values(libcdatetime_elements_t *elements,
    uint16_t *year, uint8_t *month, uint8_t *day_of_month,
    libcdatetime_error_t **error);

int
libcdatetime_elements_get_hours(libcdatetime_elements_t *elements,
    uint8_t *hours, libcdatetime_error_t **error);

int
libcdatetime_elements_get_minutes(libcdatetime_elements_t *elements,
    uint8_t *minutes, libcdatetime_error_t **error);

int
libcdatetime_elements_get_seconds(libcdatetime_elements_t *elements,
    uint8_t *seconds, libcdatetime_error_t **error);

int
libcdatetime_elements_get_milli_seconds(libcdatetime_elements_t *elements,
    uint16_t *milli_seconds, libcdatetime_error_t **error);

int
libcdatetime_elements_get_micro_seconds(libcdatetime_elements_t *elements,
    uint16_t *micro_seconds, libcdatetime_error_t **error);

int
libcdatetime_elements_get_nano_seconds(libcdatetime_elements_t *elements,
    uint16_t *nano_seconds, libcdatetime_error_t **error);

int
libcdatetime_elements_get_time_values(libcdatetime_elements_t *elements,
    uint8_t *hours, uint8_t *minutes, uint8_t *seconds,
    libcdatetime_error_t **error);

int
libcdatetime_elements_set_current_time_utc(libcdatetime_elements_t *elements,
    libcdatetime_error_t **error);

int
libcdatetime_elements_set_current_time_localtime(libcdatetime_elements_t *elements,
    libcdatetime_error_t **error);

int
libcdatetime_elements_get_delta_in_seconds(libcdatetime_elements_t *first_elements,
    libcdatetime_elements_t *second_elements,
    int64_t *number_of_seconds, libcdatetime_error_t **error);

int
libcdatetime_elements_set_from_delta_in_seconds(libcdatetime_elements_t *elements,
    int64_t number_of_seconds, libcdatetime_error_t **error);

int
libcdatetime_elements_get_string_size(libcdatetime_elements_t *elements,
    size_t *string_size, uint32_t string_format_flags,
    libcdatetime_error_t **error);

int
libcdatetime_elements_copy_to_string(libcdatetime_elements_t *elements,
    uint8_t *string, size_t string_size, uint32_t string_format_flags,
    libcdatetime_error_t **error);

int
libcdatetime_elements_copy_to_string_with_index(libcdatetime_elements_t *elements,
    uint8_t *string, size_t string_size, size_t *string_index,
    uint32_t string_format_flags, libcdatetime_error_t **error);

πŸ‘‘ Timestamp functions

int
libcdatetime_timestamp_initialize(libcdatetime_timestamp_t **timestamp,
    libcdatetime_error_t **error);

int
libcdatetime_timestamp_free(libcdatetime_timestamp_t **timestamp,
    libcdatetime_error_t **error);

int
libcdatetime_timestamp_copy(libcdatetime_timestamp_t *destination_timestamp,
    const libcdatetime_timestamp_t *source_timestamp,
    libcdatetime_error_t **error);

int
libcdatetime_timestamp_set_current_time(libcdatetime_timestamp_t *timestamp,
    libcdatetime_error_t **error);

int
libcdatetime_timestamp_get_delta_in_seconds(libcdatetime_timestamp_t *first_timestamp,
    libcdatetime_timestamp_t *second_timestamp,
    int64_t *number_of_seconds, libcdatetime_error_t **error);

int
libcdatetime_timestamp_get_string_size(libcdatetime_timestamp_t *timestamp,
    size_t *string_size, uint32_t string_format_flags,
    libcdatetime_error_t **error);

int
libcdatetime_timestamp_copy_to_string(libcdatetime_timestamp_t *timestamp,
    uint8_t *string, size_t string_size, uint32_t string_format_flags,
    libcdatetime_error_t **error);

int
libcdatetime_timestamp_copy_to_string_with_index(libcdatetime_timestamp_t *timestamp,
    uint8_t *string, size_t string_size, size_t *string_index,
    uint32_t string_format_flags, libcdatetime_error_t **error);

✨ DESCRIPTION ✨

okay so the whole thing you actually need to know for this section: the libcdatetime_get_version() function is used to retrieve the library version. that's it, that's the description. she's short and to the point πŸ’…


🌈 RETURN VALUES 🌈

so most of these functions return NULL or -1 on error β€” which one it is depends on the return type, obviously πŸ™ˆ for the actual return values, go look at "libcdatetime.h". the header is the main character here, fr fr.


πŸ“ ENVIRONMENT πŸ“

None

like, literally none. no environment variables. nothing to set. we love a low-maintenance library πŸ’–


πŸŽ€ FILES πŸŽ€

None

nope, no files either. clean girl aesthetic ✨


πŸ’€ BUGS πŸ’€

please report bugs of any kind on the project issue tracker:

https://github.com/libyal/libcdatetime/issues

yes bestie, any kind. don't be shy 🫢


πŸ¦‹ AUTHOR πŸ¦‹

these man pages are generated from "libcdatetime.h". iconic behavior honestly, the header writes its own press πŸ‘‘


Copyright (C) 2013-2024, Joachim Metz <joachim.metz@gmail.com>.

this is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

ok so real talk: no warranty, not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. like, if it breaks, it breaks. read the source for the copying conditions πŸ’–

⭐ SEE ALSO ⭐

  • the libcdatetime.h include file

and that's the whole page!! πŸ’œ this one came from libcdatetime, dropped on February 25, 2019, living in section 3 of the Library Functions Manual β€” go forth and handle your dates and times cross-platform, bestie πŸ§šβ€β™€οΈπŸŒΈ