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

extern char _monthdays[];
struct tm *localtime(const time_t *time)
{
	struct tm *t = gmtime(time);
/*	t->tm_hour += GMT_OFFS; */
	if (t->tm_hour > 23) {
		t->tm_hour -= 24;
		t->tm_mday++;
		if (_monthdays[t->tm_mon] < t->tm_mday) {
			t->tm_mon++;
			t->tm_mday = 1;
			if (t->tm_mon > 12) {
				t->tm_mon = 1;
				t->tm_year++;
			}
		}
	}
	return t;
}