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

int main ()
  {
  time_t epoc;        /* 32-Bit-Zahl   */
  struct tm info;     /* Datum/Uhrzeit */
  char buffer[80];    /* Ausgabepuffer */

  info.tm_year = 2013 - 1900; /* Jahr - 1900 */
  info.tm_mon = 11 - 1;       /* Monat geht von 0 - 11! */
  info.tm_mday = 4;
  info.tm_hour = 9;
  info.tm_min = 15;
  info.tm_sec = 1;
  info.tm_isdst = -1;         /* Differenz zu GMT */

  printf("Test mit 4.11.2013, 9:15:01:\n");
  /* Inhalt von info in String umwandeln (fuer Ausgabe) */
  epoc = mktime(&info);                        
  if( epoc == -1 )
    printf("Error: unable to make time using mktime\n");
   else
     {
     printf("Aus epoc berechnet:  %s",ctime(&epoc));
     strftime(buffer, sizeof(buffer), "%c", &info );
     printf("Aus dem info-Record: %s\n",buffer);
     }

  printf("Nun dasselbe mit 'now': ");
  epoc = time(NULL);
  printf("%s\n",ctime(&epoc));

  return(0);
  }
