how to find currrent date and time using c program
Answers
Answered by
0
C Program to Display the current Date and Time
The C library function char *ctime(const time_t *timer) returns a string representing the localtime based on the argument timer. The returned string has the following format: Www Mmm dd hh:mm:ss yyyy. Here Www is the weekday, Mmm the month in letters, dd the day of the month, hh:mm:ss the time and yyyy the year.
Below is the program to display current date and time.
#include<time.h> is used for time and ctimefunction and time_t datatype.
The C library function char *ctime(const time_t *timer) returns a string representing the localtime based on the argument timer. The returned string has the following format: Www Mmm dd hh:mm:ss yyyy. Here Www is the weekday, Mmm the month in letters, dd the day of the month, hh:mm:ss the time and yyyy the year.
Below is the program to display current date and time.
#include<time.h> is used for time and ctimefunction and time_t datatype.
Similar questions