Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Create a console application that prints the current date and time.
- * (15 September 2015 16:25:17)
- */
- #include <stdio.h>
- #include <time.h>
- int main()
- {
- time_t t = time(NULL);
- struct tm tm = *localtime(&t);
- char timeString[50];
- strftime(timeString, sizeof(timeString) - 1, "%d %F %Y %H:%i:%s", tm);
- printf("Current Date and Time is: %s\n", timeString);
- return (0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement