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
421 B

#include "fmt.h"
#include "scan.h"
#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
struct timespec t;
assert(scan_iso8601("2015-05-13T21:17:23Z",&t)==20 && t.tv_sec==1431551843);
assert(scan_iso8601("2015-05-13T14:17:23-0700",&t)==24 && t.tv_sec==1431551843);
return 0;