Skip to content

Wrong year when using the --input-date-format "%F" option with the register command #1775

@ghost

Description

I'm running app-office/ledger-3.1.1-r2 on a Gentoo Linux system.

Ledger incorrectly shows transactions in the future even when in the source file they are set in the past. Day and month are the same, but the year is different.

Example of source file (~/tmp/xxx.dat):

payee yyy

account Risorse:Intesa
account Entrate:XXX

commodity €

2018-03-30 yyy
 Risorse:Intesa  2,88 €
 Entrate:XXX

On the command line:

$ ledger --file ~/tmp/xxx.dat register --input-date-format "%F"
19-Mar-30 yyy                                           Risorse:Intesa                                                            2,88 €                      2,88 €
                                                        Entrate:XXX                                                              -2,88 €                           0

As you can see, ledger displays 19-Mar-30 instead of 18-Mar-30.

If you drop the --input-date-format "%F" option everything is OK:

$ ledger --file ~/tmp/xxx.dat register 
18-Mar-30 yyy                                           Risorse:Intesa                                                            2,88 €                      2,88 €
                                                        Entrate:XXX                                                              -2,88 €                           0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions