Chicken 2.6 has inconsistent meaning for timezone offset across platforms. 2.61 fixed this.

Provided you are not using MacOS X or Windows you can get the current version (2.6.9) which skips the requirement otherwise.

Well, I was in a rush, so I've wrapped strftime(). This might actually be useful to others, so I'm posting it. I've used SWIG, but I'm sure it's trivial using the Chicken FFI (which I don't know though):

#include <time.h>
#include <stdlib.h>
#include <string.h>

// See strftime(3) manpage for format string
char *system_time (const char *fmt) {
  time_t t;
  struct tm tm;

  time (& t);
  localtime_r (& t, & tm);
  char buf [500];
  size_t ret = strftime (buf, sizeof (buf), fmt, & tm);
  if (ret == 0) return NULL;
  else {
    char *res = malloc (ret + 1);
    memcpy (res, buf, ret + 1);
    return res;
  }
}


_______________________________________________
Chicken-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to