Hacker News new | ask | show | jobs
by seabass-labrax 328 days ago
I used to use GnuCash, but a small yet constant irritation for me was how the entry's date (that is, the date when I authorized the transaction) wouldn't always match the clearing date of the transaction as reported by my bank in their statements.

hledger, however, has support for adding 'posting dates' as specially formatted comments. What's really clever is how it automatically chooses which date to sort the reports by depending on the query!

For example, say I have a ledger that exclusively contains entries consisting of credits to a assets account (bank) and debits to an expense account (shopping). The date of the debit is earlier, because I acquired the goods at the shop. The date of the credit is later because it takes a while for the payment to clear between the banks. Some payments take longer to clear than others so the order isn't the same.

If I ask hledger for a report of all recent transactions that involve expenses, it will sort by the dates on the debit lines. But if I ask hledger for a report of all the recent transactions that involve assets it'll use the credit dates instead! This makes reconciliation with my bank statements so much easier and tidier whilst still keeping an accurate record of when I actually made the transactions.

1 comments

Is it like ledger's effective dates? https://ledger-cli.org/doc/ledger3.html#Effective-Dates
Yes, it's very similar! However, hledger's posting dates are a little more flexible, as you can have anything from no additional dates to one date per individual posting (debit or credit) in the transaction. This might perhaps be useful if you have complex split transactions where a balance is settled by multiple payments.

Just recently I bought an item on sale for 15 Euros with a card in Sterling (my bank did the currency conversion). Pretty much immediately after paying, though, I exchanged it for a different item for 25 Euros, making up the difference in cash. The cash is obviously 'cleared' instantly but the card payment could clear later. That said, in this case it happened to clear the same day anyway so no special posting date was required.

  2025-08-10 Redacted
  Expenses: Redacted  13.03 GBP
  Expenses: Redacted     10 EUR
  Assets: Bank       -13.03 GBP
  Assets: Cash          -10 EUR
I suppose the main question is at what point these splits become complex enough to create a dedicated liabilities account specifically to track the payment of that one expense, à la accounts payable, which you can of course do with any plain text ledger.
They are different - though often tried for the same kinds of use case. Here's https://hledger.org/hledger.html#secondary-dates (hledger's name for effective dates) vs https://hledger.org/hledger.html#posting-dates. (Both features come from Ledger.)