/* Collection of code snippets by Arne Vajhøj */
/* (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) */
#include <stdio.h>
#include <stdlib.h>
#include <time.h>

int main()
{
    time_t t; /* point in time */
    struct tm *t2; /* time broken up in YMDHMS parts */
    char buf[100];
    t = time(NULL);
    t2 = localtime(&t);
    printf("%02d/%02d/%04d %02d:%02d:%02d\n", t2->tm_mday, 1 + t2->tm_mon, 1900 + t2->tm_year, t2->tm_hour, t2->tm_min, t2->tm_sec);
    strftime(buf,sizeof(buf), "%d/%m/%Y %H:%M:%S", t2);
    printf("%s\n", buf);
    return 0;
}
