2012-10-18 09:55:16 +00:00
|
|
|
#if defined(__linux__) || defined(__MINT__)
|
2014-11-22 18:08:25 +00:00
|
|
|
# define _GNU_SOURCE /* strptime() */
|
2012-10-18 09:55:16 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <time.h>
|
|
|
|
|
|
|
|
int
|
2014-11-22 18:08:25 +00:00
|
|
|
main(void)
|
2012-10-18 09:55:16 +00:00
|
|
|
{
|
|
|
|
struct tm tm;
|
2014-11-22 18:08:25 +00:00
|
|
|
const char input[] = "2014-01-04";
|
2016-01-15 23:08:59 +00:00
|
|
|
return ! (strptime(input, "%Y-%m-%d", &tm) == input + 10 &&
|
|
|
|
tm.tm_year == 114 && tm.tm_mon == 0 && tm.tm_mday == 4);
|
2012-10-18 09:55:16 +00:00
|
|
|
}
|