strftime Function in C Programming Language Video Tutorial

preview_player
Показать описание
In this C programming language video tutorial / lecture for beginners video series, you will learn about usage of strftime() function in c programming to format the date and time as you want in detail with example..

This video begins with the explanation of the strftime function including its syntax, parameters required and then explains the format specifiers or the format commands available for the strftime function and also explains how to use this function to format the date and time with an example in detail.

Learn Programming in HINDI at our youtube channel

Catch us on Social Media
Рекомендации по теме
Комментарии
Автор

How to make the program overwrite its current time...I mean, to make the clock run continuously without having to start the program again or pressing enter..

samueljohn
Автор

#include<stdio.h>
#include<time.h>

/**
size_t strftime(char *str, size_t maxsize, const char *fmt, const struct tm *time);

%A Full weekday name
%B Full month name
%c Standard date and time string
%H Hour (0-23)
%I Hour (1-12)
%p Locale's equivalent of AM or PM
%M Minute as decimal (0-59)
%S Second as decimal (0-60)
%X Standard time string
%Z Time zone name
*/
int main()
{
struct tm *ptr;
time_t t;
char str[100];

t = time(NULL);
ptr = localtime(&t);

strftime(str, 100, "It is now %I %P %M minutes %S seconds\ntime zone is %Z", ptr);
puts(str);
return 0;
}

its printing nothing.
what's the problem?

tamzidmahmud
welcome to shbcf.ru