jwiegley/ledger — Issue #48: Input date format not recognized
Author: jonasvp
Created: 2011-12-06 20:45:18+00:00
State: open

Hi,

first of all, thanks a lot for ledger! I'm actually having _fun_ doing our bookkeeping! The combination with (a hacked version of) icsv2ledger.py is dynamite...

Anyway, we're based in Germany and I'd like to enter dates in German format: `%d.%m.%Y`. I can get ledger to use this format when outputting dates with the "--date-format" option. However, I haven't found a way to get ledger to _accept_ dates in this format as input.

For instance, a ledger file looking like this:

2011/10/01 4b4e2a89
ef9d9585:efa1fb7b:22845e93:0e3763f0 2,00 A
2c166ff7:d34e3aa1:8a5075b3:56f3c726

2011/10/01 15983995
eb78b6c0:a2857de3:d6d8ea07:6688fc4e 2,58 A
ba3ffe56:c3ba36a5:aa63399f:e9e1d043

results in this output from `ledger print`:

01.10.2011 4b4e2a89
ef9d9585:efa1fb7b:22845e93:0e3763f0 2,00 A
2c166ff7:d34e3aa1:8a5075b3:56f3c726

01.10.2011 15983995
eb78b6c0:a2857de3:d6d8ea07:6688fc4e 2,58 A
ba3ffe56:c3ba36a5:aa63399f:e9e1d043

Putting this exact output back into ledger results in:

$ ledger -f test.ledger bal
While parsing file "test.ledger", line 1:
While parsing transaction:
> 01.10.2011 15983995
Error: Invalid date: 01.10.2011
While parsing file "test.ledger", line 5:
While parsing transaction:
> 01.10.2011 15983995
Error: Invalid date: 01.10.2011

Using the (undocumented) option "--input-date-format=%d.%m.%Y" yields the same result.

I'm using Ledger 3.0.0-20110325 from the Ubuntu PPA repository Michael Budde created (https://launchpad.net/~mbudde/+archive/ledger) under Ubuntu 11.10. I'd be very grateful for any pointers!

Cheers,

Jonas