From bff42f702accee3ec4b53b1efd254cf3c1237214 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Tue, 31 May 2005 04:56:14 +0000 Subject: Added `input_format' array, and made `formats' external. --- datetime.cc | 4 +++- datetime.h | 8 ++++---- 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 -- cgit v1.2.3