Quantcast
Channel: Intel Communities: Message List
Viewing all articles
Browse latest Browse all 18347

Re: How to get current time

$
0
0

ok, I'll take another stab at this for you.  It formats properly to your YYYYMMDD:HHMMSS on mine.

in your file at the top,

 

#include <time.h>

 

in your function try

time_t t = time(NULL);

struct tm tm = *localtime(&t);

when your ready to print it

printf("%04d%02d%02d:%02d%02d%02d",tm.tm_year+1900,tm.tm_mon+1,tm.tm_mday,tm.tm_hour,tm.tm_min,tm.tm_sec);


Viewing all articles
Browse latest Browse all 18347

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>