Mirror of :pserver:cvs@cvs.fefe.de:/cvs libowfat https://www.fefe.de/libowfat/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
338 B

7 years ago
#include <fmt.h>
#include <scan.h>
7 years ago
#include <assert.h>
#include <unistd.h>
int main() {
char buf[1024];
buf[fmt_iso8601(buf,1431551843)]=0; // Wed May 13 14:17:23 PDT 2015
assert(!strcmp(buf,"2015-05-13T21:17:23Z"));
struct timespec t;
assert(scan_iso8601("2015-05-13T21:17:23Z",&t)==20 && t.tv_sec==1431551843);
7 years ago
return 0;
}