How to get the current date and time C language

http‮www//:s‬.lautturi.com
How to get the current date and time C language
/*
Get current local date and time in C language
*/

#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/unistd.h>
#include <sys/time.h>

int main ()
{
  time_t rawtime;
  struct tm * timeinfo;

  time ( &rawtime );
  timeinfo = localtime ( &rawtime );
  printf ( "date and time: %s", asctime (timeinfo) );

  return 0;
}
Created Time:2017-08-28 19:23:18  Author:lautturi