time_t now; now = time(NULL); struct tm *tm; tm = localtime (&now); char timestamp[200]; strftime (timestamp, 200, "%m/%d/%Y-%H:%M", tm);