File: test-strptime.c

package info (click to toggle)
mdocml 1.14.6-4
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 10,536 kB
  • sloc: ansic: 37,110; makefile: 1,159; sh: 562; perl: 413
file content (10 lines) | stat: -rw-r--r-- 212 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
#include <time.h>

int
main(void)
{
	struct tm tm;
	const char input[] = "2014-01-04";
	return ! (strptime(input, "%Y-%m-%d", &tm) == input + 10 &&
	    tm.tm_year == 114 && tm.tm_mon == 0 && tm.tm_mday == 4);
}