What is the most efficient way of getting current time/date/day/year in C language? As I have to execute this many times, I need a real efficient way.
I am on freeBSD.
thanks ...
To elaborate on Banfa's answer: there is no Standard C Library function that is guaranteed to give you current date and time with millisecond resolution. You either need to make use of the details of how your platform supports implementation-dependent features of the functions or you need to make use of nonstandard functions provided by your platform. Does the hardware ...
I am a newbie of C and I need to do a program to get the current date information only, without the time. I have my code here: #include #include #include int main () { time_t rawtime; struct tm * timeinfo; char* t; rawtime = time (NULL); timeinfo = localtime (&rawtime); t = asctime(timeinfo); printf(t); return 0; } ...
Hi All, I want a C programme which will take a user input as a date and number of days, and then it will add the given number of days to the input date and will give the resulted date. It should keep in mind all the permutation and combinations like changing month year , leap year, some months have 31 ...
Hi All, I want a C programme which will take a user input as a date and number of days, and then it will add the given number of days to the input date and will give the resulted date. It should keep in mind all the permutation and combinations like changing month year , leap year, some months have 31 ...