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

Re: How to get current time

$
0
0

Hope this may be helpful.  I am assuming a sketch is using c;

 

#include <time.h>

 

void main() {

time_t t;

struct tm *ptr_time;

char buffer[22];

// get the local time

time(&t);

// returns localtime to a tm structure

ptr_time = localtime(&t);

// converts time to a specific string

strfttime(buffer, 22, "%Y.%m.%d %H:%M:%S ", ptr_time);

printf("%s\n",buffer);

}


Viewing all articles
Browse latest Browse all 18146

Trending Articles



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