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

Re: How to get current time

$
0
0

deium thank you for your reply.

 

I am using Arduino's c/c++ and the Edison board.

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

unfortunately strfttime is not available in Arduino c.

 

This works some of the time, but does not compile at other times.

#include<time.h>

char cTime[22];

sprintf(cTime, "%04d%02d%02d:%02d%02d%02d", year(), month(), day(), hour(), minute(), second());

When it does compile it return 19700101:010100 not 20141111:0532

 

Here are the errors:

 

 

 

fcntl.h:In file included from

 

fast_gpio_common.c:from

 

stat.h:91:21: error: field 'st_atim' has incomplete type

 

:struct timespec st_atim; \* Time of last access. *\

 

:^

 

stat.h:92:21: error: field 'st_mtim' has incomplete type

 

:struct timespec st_mtim; \* Time of last modification. *\

 

:^

 

stat.h:93:21: error: field 'st_ctim' has incomplete type

 

:struct timespec st_ctim; \* Time of last status change. *\

 

:^

 

fcntl.h:In file included from

 

variant.cpp:from

 

stat.h:91:21: error: field 'st_atim' has incomplete type

 

:struct timespec st_atim; \* Time of last access. *\

 

:^

 

stat.h:92:21: error: field 'st_mtim' has incomplete type

 

:struct timespec st_mtim; \* Time of last modification. *\

 

:^

 

stat.h:93:21: error: field 'st_ctim' has incomplete type

 

:struct timespec st_ctim; \* Time of last status change. *\

 

:^

 

stat.h:152:21: error: field 'st_atim' has incomplete type

 

:struct timespec st_atim; \* Time of last access. *\

 

:^

 

stat.h:153:21: error: field 'st_mtim' has incomplete type

 

:struct timespec st_mtim; \* Time of last modification. *\

 

:^

 

stat.h:154:21: error: field 'st_ctim' has incomplete type

 

:struct timespec st_ctim; \* Time of last status change. *\

 

:^

 

Error compiling core


Viewing all articles
Browse latest Browse all 17516

Trending Articles



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