Answers for "getting current time c"

C
4

c get time

/* localtime example */
#include <stdio.h>
#include <time.h>

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

  time ( &rawtime );
  timeinfo = localtime ( &rawtime );
  printf ( "Current local time and date: %s", asctime (timeinfo) );
  
  return 0;
}
Posted by: Guest on January-14-2021
-1

time now c

#include <time.h>
time_t now = time(0); // Get the system time
Posted by: Guest on April-23-2020

Code answers related to "C"

Browse Popular Code Answers by Language