LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   strftime(buffer,50,"%d/%m/%Y %H:%M:%S",loctime); (https://www.linuxquestions.org/questions/programming-9/strftime-buffer-50-d-m-y-h-m-s-loctime-%3B-359770/)

alaios 09-03-2005 05:00 AM

strftime(buffer,50,"%d/%m/%Y %H:%M:%S",loctime);
 
How do u know how can i also get the milliseconds of time?
strftime(buffer,50,"%d/%m/%Y %H:%M:%S",loctime);

With the strftime i can get and the secs but i am not sure that this function can provide me also the ms.. I have cheched the manual but nothing appropriate
was found

mschutte 09-03-2005 01:07 PM

Sorry, but I think the system clock is not exactly enough to provide milliseconds information. `struct tm', the data structure holding system clock information (see localtime(3)), has no entry therefore.

alaios 09-04-2005 04:00 AM

Are u sure about that?

mschutte 09-09-2005 06:26 AM

Sorry, I was away for some days.
I've finally found a function which can give you the number of seconds since the Epoch, and the number of additional microseconds. Have a look at gettimeofday(2), declared in <sys/time.h>.

Hope I could help,
mschutte


All times are GMT -5. The time now is 07:17 PM.