mirror of https://github.com/wb2osz/direwolf.git
Shortened timestamp.
This commit is contained in:
parent
fa49b6a40b
commit
7646fc5748
12
src/eotd.c
12
src/eotd.c
|
@ -250,10 +250,14 @@ void eotd_to_text (unsigned char *eotd, int eotd_len, char *text, int text_size)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef EOTD_TIMESTAMP
|
#ifdef EOTD_TIMESTAMP
|
||||||
time_t now = time(NULL);
|
time_t t = time(NULL);
|
||||||
strlcat(text, "timestamp=", text_size);
|
struct tm *now = localtime(&t);
|
||||||
strlcat(text, ctime(&now), text_size);
|
char date_buffer[32];
|
||||||
text[strlen(text) -1] = ','; // zap lf
|
strlcat(text, "ts=", text_size);
|
||||||
|
sprintf(date_buffer, "%d-%02d-%02dT%02d:%02d:%02d,",
|
||||||
|
now->tm_year + 1900, now->tm_mon + 1, now->tm_mday,
|
||||||
|
now->tm_hour, now->tm_min, now->tm_sec);
|
||||||
|
strlcat(text, date_buffer, text_size);
|
||||||
#endif
|
#endif
|
||||||
get_chain(pkt, text, text_size);
|
get_chain(pkt, text, text_size);
|
||||||
add_comma(text, text_size);
|
add_comma(text, text_size);
|
||||||
|
|
Loading…
Reference in New Issue