Tiny library to manage calendars and date/time stamps (ISO, TAI, JD, MJD...)
License
ajdiaz/libcalby
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
master
Could not load branches
Nothing to show
Could not load tags
Nothing to show
{{ refName }}
default
Code
-
Clone
Use Git or checkout with SVN using the web URL.
Work fast with our official CLI. Learn more.
- Open with GitHub Desktop
- Download ZIP
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
libcalby: a tiny calendar library ================================= The libcalby provides a suite of tools to manage different calendars easy. Currently supports Gregorian Calendar and Julian Calendar, and also support a number of formats for date and time, including ISO, TAI64, Julian Date and Modified Julian Date. libcalby still under development, and new calendars and formats will be added in the future. Example of usage ---------------- #include <stdio.h> #include "calby.h" int main (int argc, char **argv) { cal_datetime_t t; uint64_t tai; char buf[CAL_ISOFMT_LEN]; cal_now(&t); /* get current time */ cal_format(&t,buf); /* human readable */ /* print date-time in human readable form */ printf("%s\n", buf); /* print julian date */ printf("%ld\n", cal_jd(&t)); /* print modified julian date */ printf("%ld\n", cal_mjd(&t)); /* print TAI form */ printf("@%llx\n", cal_tai(&t)); /* add leap seconds to tai */ /* /etc/leapseconds.dat must be exists */ tai = cal_tai(&t); cal_leapsecs_add(&tai); /* print TAI with leap seconds */ printf("@%llx\n", tai); /* get julian calendar date */ cal_julian(&t); cal_format(&t,buf); printf("%s\n",buf); }
About
Tiny library to manage calendars and date/time stamps (ISO, TAI, JD, MJD...)
Resources
License
Stars
Watchers
Forks
Packages 0
No packages published