diff options
Diffstat (limited to 'contrib/mdocml/test-strptime.c')
-rw-r--r-- | contrib/mdocml/test-strptime.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/contrib/mdocml/test-strptime.c b/contrib/mdocml/test-strptime.c new file mode 100644 index 0000000..bedc775 --- /dev/null +++ b/contrib/mdocml/test-strptime.c @@ -0,0 +1,14 @@ +#if defined(__linux__) || defined(__MINT__) +# define _GNU_SOURCE /* strptime() */ +#endif + +#include <time.h> + +int +main(void) +{ + struct tm tm; + const char input[] = "2014-01-04"; + return( ! (input+10 == strptime(input, "%Y-%m-%d", &tm) && + 114 == tm.tm_year && 0 == tm.tm_mon && 4 == tm.tm_mday)); +} |