logo

gemini-space

What lives at gemini://hacktivis.me/ git clone https://hacktivis.me/git/gemini-space.git

mdate.c (415B)


  1. #define _POSIX_C_SOURCE 200809L
  2. #include <time.h> /* time */
  3. #include <stdio.h> /* printf */
  4. // 3600*24.5
  5. #define cycle 88200
  6. int
  7. main(void) {
  8. time_t now = time(NULL);
  9. time_t date_now = now / cycle;
  10. time_t time_now = now % cycle;
  11. printf("20 text/gemini; charset=utf-8\r\n");
  12. printf("On a 24.5h cycle it is now: %lX,%05lX\n", date_now, time_now);
  13. printf("=> /cgi-src/mdate.c Source code\n");
  14. return 0;
  15. }