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

#define TIMEBUFSIZE 60

int main () {
 time_t t;
 char timebuf[TIMEBUFSIZE];

 t = time (NULL);

 if (((time_t) -1) == t) {
  perror ("getting time");
  return EXIT_FAILURE;
 }

 if (!strftime (timebuf, TIMEBUFSIZE, "%F %k:%M", localtime (&t))) {
  perror ("formatting time");
  return EXIT_FAILURE;
 }

 printf ("time: %s\n", timebuf);

 return EXIT_SUCCESS;
}
