marxin marxin - 3 years ago 194
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 Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download