File: nntpd_dodate.c

package info (click to toggle)
leafnode 1.11.11-1
  • links: PTS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 2,468 kB
  • sloc: ansic: 10,914; sh: 1,748; xml: 628; makefile: 291; perl: 84; sed: 4
file content (20 lines) | stat: -rw-r--r-- 354 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <stdio.h>
#include "system.h"
#include "nntpd.h"

void
dodate(void)
{
    time_t t;
    if (time(&t) == (time_t)-1) {
	printf("500 Internal error\r\n");
    } else {
	struct tm *tm;
	tm = gmtime(&t);
	printf("111 %04d%02d%02d%02d%02d%02d\r\n",
		tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday,
		tm->tm_hour, tm->tm_min, tm->tm_sec);
    }
}