Beispiel #1
0
int main(int argc,char *argv[])
{
	/*timt_t*/unsigned bigest = 0x7fffffff;
	int year = atoi(argv[1]);
	int mom = atoi(argv[2]);
	int day = atoi(argv[3]);
	int hour = atoi(argv[4]);
	int min = atoi(argv[5]);
	int sec = atoi(argv[6]); 
	printf("date %d-%d-%d %d:%d:%d\n",year,mom,day,hour,min,sec);
	printf("bigest = %s\n",ctime(&bigest));
	printf("bigest = %s\n",asctime(gmtime(&bigest)));
	printf("time = %d \n",mymktime(year,mom,day,hour,min,sec));
	return 0;
}
Beispiel #2
0
static void
add_news_message(Str str, int index, char *date, char *name, char *subject,
		 char *mid, char *scheme, char *group)
{
    time_t t;
    struct tm *tm;

    name = name_from_address(name, 16);
    t = mymktime(date);
    tm = localtime(&t);
    Strcat(str,
	   Sprintf("<tr valign=top><td>%d<td nowrap>(%02d/%02d)<td nowrap>%s",
		   index, tm->tm_mon + 1, tm->tm_mday, html_quote_s(name)));
    if (group)
	Strcat(str, Sprintf("<td><a href=\"%s%s/%d\">%s</a>\n", scheme, group,
			    index, html_quote(subject)));
    else
	Strcat(str, Sprintf("<td><a href=\"%s%s\">%s</a>\n", scheme,
			    html_quote(file_quote(mid)), html_quote(subject)));
}