You cannot 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
C

9 years ago
#include <fmt.h>
#include <scan.h>
9 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);
9 years ago
return 0;
}