diff --git a/src/rrd_parsetime.c b/src/rrd_parsetime.c
index 7fa355938fe6ed399bc955f7626f86d345087623..a5f1db8910bdc4755869de1cbcbf01c11fa34122 100644 (file)
--- a/src/rrd_parsetime.c
+++ b/src/rrd_parsetime.c
/* Local headers */
-#include "rrd_tool.h"
#include <stdarg.h>
+#include <stdlib.h>
+#include <ctype.h>
+
+#include "rrd_tool.h"
/* Structures and unions */
enum { /* symbols */
MIDNIGHT, NOON, TEATIME,
- PM, AM, YESTERDAY, TODAY, TOMORROW, NOW, START, END,
+ PM, AM, YESTERDAY, TODAY, TOMORROW, NOW, START, END, EPOCH,
SECONDS, MINUTES, HOURS, DAYS, WEEKS, MONTHS, YEARS,
MONTHS_MINUTES,
NUMBER, PLUS, MINUS, DOT, COLON, SLASH, ID, JUNK,
{"s", START},
{"end", END},
{"e", END},
+ {"epoch", EPOCH},
{"jan", JAN},
{"feb", FEB},
{
/* using time_t seems to help portability with 64bit oses */
time_t mday = 0, wday, mon, year = ptv->tm.tm_year;
- int tlen;
switch (sc_tokid) {
case YESTERDAY:
case NUMBER:
/* get numeric <sec since 1970>, MM/DD/[YY]YY, or DD.MM.[YY]YY
*/
- tlen = strlen(sc_token);
mon = atol(sc_token);
if (mon > 10 * 365 * 24 * 60 * 60) {
ptv->tm = *localtime(&mon);
case MINUS:
break; /* jump to OFFSET-SPEC part */
+ case EPOCH:
+ ptv->type = RELATIVE_TO_EPOCH;
+ goto KeepItRelative;
case START:
ptv->type = RELATIVE_TO_START_TIME;
goto KeepItRelative;