marxin marxin - 6 months ago 79
C Question

Struct timeval to printable format

Could you please help me how to format a

struct timeval
instance to human readable format like "2010-01-01 15:35:10.0001"?

Answer

Convert the tv_sec using localtime, and strftime, then append tv_usec part.