192395e9cSLionel Sambuc #if defined(__linux__) || defined(__MINT__) 2*0a6a1f1dSLionel Sambuc # define _GNU_SOURCE /* strptime() */ 392395e9cSLionel Sambuc #endif 492395e9cSLionel Sambuc 592395e9cSLionel Sambuc #include <time.h> 692395e9cSLionel Sambuc 792395e9cSLionel Sambuc int main(void)8*0a6a1f1dSLionel Sambucmain(void) 992395e9cSLionel Sambuc { 1092395e9cSLionel Sambuc struct tm tm; 11*0a6a1f1dSLionel Sambuc const char input[] = "2014-01-04"; 12*0a6a1f1dSLionel Sambuc return( ! (input+10 == strptime(input, "%Y-%m-%d", &tm) && 13*0a6a1f1dSLionel Sambuc 114 == tm.tm_year && 0 == tm.tm_mon && 4 == tm.tm_mday)); 1492395e9cSLionel Sambuc } 15