Andrés J. Díaz

libcalby


Latest stable relases:

Source:releases/libcalby-0.1.tar.gz
Signature:releases/libcalby-0.1.tar.gz.asc

Show all releases
Github page

Contents:


README

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);
  }



CONTRIBUTE

The source code of the project is managed by git, you can clone it in the usual way:

git clone https://git.ajdiaz.me/libcalby

A mirror in github is also available, but keep in mind that could be out of date.

If you find any error in the code or incorrect behaviour, please do not hesitate to report it in the devel mailing list: libcalby-devel@lists.ajdiaz.me.

Please note that you need to subscribe to the list prior to post to avoid spam, just send an empty email to help@lists.ajdiaz.me with the text subscribe libcalby-devel in the subject.

Please submit the patches via mailing list. You can read how to in this email + git guide

Any suggestion, discussion or improvement are welcome, just mail to the list!


Andrés J. Díaz <ajdiaz at ajdiaz.me>.
GPG Key: 4D851F4ECDCFD81EF6AB2FC6021D2DCF8575C18B. GPG Key Signing Policy.
Gopher server