VOOZH about

URL: https://www.geeksforgeeks.org/c/c-program-print-digital-clock-current-time/

⇱ C program to print digital clock with current time - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

C program to print digital clock with current time

Last Updated : 16 Nov, 2021

The time.h header defines four variable types, two macro and various functions for manipulating date and time. A brief description of the variable types defined in the header time.h is as : 
 

  • size_t : This is the unsigned integral type and is the result of the sizeof keyword.
  • clock_t : This is a type suitable for storing the processor time.
  • time_t is : This is a type suitable for storing the calendar time.
  • struct tm : This is a structure used to hold the time and date.


Below is the implementation of digital clock. On executing the program, the output window will show the time when the program was executed. 
 

Output : 
 

👁 Image


Below is the C program to show the current time inside a rectangular bar. The output window shows the day, month, date, current time and year.
 

Output : 
 

👁 Image


References : 
cprogramforbeginners
 

Comment