#include <stdio.h>
#include <stdlib.h>
#include <time.h>


void datimx_(int *now) {

	time_t timep;
	struct tm *time_s;

	timep = time(NULL);

	time_s = localtime(&timep);

	now[0] = 1;		/* valid clock */
	now[1] = 0;		/* ms */
	now[2] = time_s->tm_sec;
	now[3] = time_s->tm_min;
	now[4] = time_s->tm_hour;
	now[5] = time_s->tm_mday;
	now[6] = time_s->tm_mon + 1;
	now[7] = time_s->tm_year + 1900;
	now[8] = -1;
	if (time_s->tm_hour == 0) {
	    now[9] = 12;
	    now[10] = 1;
	}
	else if (time_s->tm_hour <= 12) {
	    now[9] = time_s->tm_hour;
	    now[10] = 1;
	}
	else {
	    now[9] = time_s->tm_hour - 12;
	    now[10] = 2;
	}
	now[11] = time_s->tm_wday + 1;
	now[12] = time_s->tm_yday + 1;
	now[13] = now[7] % 100;
}
