[elektro] localtime gond
zulu
zulu at gmail.hu
Wed Sep 14 21:31:22 CEST 2016
Hi,
AVR-el ntp ref. időből kell a dátumot kihámoznom, de valamiért nem jó a dátum:
#include "time.h"
struct tm ts;
uint32_t epoch = 1473880796UL; // most ezt ide direkt beírtam. Linuxon ez: 2016-09-14, 21:19:56 ami korrekt
// http://www.timestampconvert.com/?go2=true&offset=-2×tamp=1473880796&Submit=++++++Convert+to+Date++++++
.
ts = *localtime( &epoch );
printf( "%04i-%02i-%02i\r\n", ts.tm_year, ts.tm_mon, ts.tm_mday );
2046-09-14 jön ki. Mi lehet az oka?
-zulu
More information about the Elektro
mailing list