
How to display the current date and time in ISO standard format using C language?
Current Date and Time will take the entered time and attempt to print the system time and date in ISO format.
For example, Monday, December 15, 2020 at 10:50.
Built - The function we are using in this program is -
Time() - Returns the current time.
Strftime() − Convert time to string form, this function is included in time.h.
Live demonstration
#include<stdio.h>
#include<time.h>
int main(){
time_t current = time(NULL);
char datetime[20];
strftime(datetime,sizeof(datetime),"%a,%d%b%y %H:%M",localtime(¤t));
puts(datetime);
return 0;
}Thu,31 Dec 20 22:41
The above is the detailed content of Write a C program that uses time.h library functions. For more information, please follow other related articles on the PHP Chinese website!
What are the commonly used functions of informix?
What to do if the computer fakes death
Which company does Android system belong to?
Solution to sql procedure syntax error
How to skip network connection during win11 installation
My computer can't open it by double-clicking it.
How to check website dead links
Build your own git server