summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--datetime.cc4
-rw-r--r--datetime.h8
2 files changed, 7 insertions, 5 deletions
diff --git a/datetime.cc b/datetime.cc
index 0e821da6..d916a2d1 100644
--- a/datetime.cc
+++ b/datetime.cc
@@ -20,7 +20,9 @@ static const int month_days[12] = {
31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
};
-static const char * formats[] = {
+char input_format[128];
+
+const char * formats[] = {
"%Y/%m/%d",
"%m/%d",
"%Y.%m.%d",
diff --git a/datetime.h b/datetime.h
index 75d554e0..78054ec2 100644
--- a/datetime.h
+++ b/datetime.h
@@ -47,14 +47,14 @@ struct interval_t
void parse(std::istream& in);
};
-extern std::time_t now;
-extern int now_year;
+extern std::time_t now;
+extern int now_year;
+extern char input_format[128];
+extern const char * formats[];
bool parse_date_mask(const char * date_str, struct std::tm * result);
-
bool parse_date(const char * date_str, std::time_t * result,
const int year = -1);
-
bool quick_parse_date(const char * date_str, std::time_t * result);
} // namespace ledger