C program to get current system date and time in Linux
This program will get the current system date and time in Linux operating system using GCC or G++ compiler.
System local time can be extracted by using struct tm, and function localtime() which are declared in <time.h> header file. Following are the members of tm structure: tm.tm_mday, tm.tm_mon, tm.tm_year, tm.tm_hour, tm.tm_min, tm.tm_sec.
Print system Date and Time in Linux using C program
Output:
need an explanation for this answer? contact us directly to get an explanation for this answer