plaintextaccounting.org

Time tracking

You can track time in the usual journal format. Eg with h/ledger, using non-balanced postings for convenience:

# a.journal
2022-01-01
   (time:work)   2h
   (time:rest)   1.5h
   (time:play)   2.5h

Strict version, disallowing undeclared accounts/commodities:

# b.journal
commodity h
account time:work
account time:rest
account time:play

2022-01-01
   (time:work)   2h
   (time:rest)   1.5h
   (time:play)   2.5h
$ ledger -f b.journal --pedantic bal
$ hledger -f b.journal -s bal

With beancount (always strict):

# a.beancount
2000-01-01 open Equity:Time
2000-01-01 open Expenses:Time:Work
2000-01-01 open Expenses:Time:Rest
2000-01-01 open Expenses:Time:Play

2022-01-01 txn
   Expenses:Time:Work   2 HRS
   Expenses:Time:Rest   1.5 HRS
   Expenses:Time:Play   2.5 HRS
   Equity:Time
$ bean-report a.beancount bal

Or, there is timeclock format (ledger, hledger), which tracks clock-in/clock-out times:

# a.timeclock (hledger), or can be inlined in your main journal (ledger)
i 2009/03/27 09:00:00 projects:a
o 2009/03/27 17:00:34
i 2009/03/31 22:21:45 personal:reading:online
o 2009/04/01 02:00:34
i 2009/04/02 09:00:00 projects:b
o 2009/04/02 17:00:34

Or timedot format (hledger), for approximate/visual time logging (each dot is a quarter hour):

# a.timedot

2016/2/1
fos:haskell   ....
biz:research  .
inc:client1   .... .... .... .... .... ....

2016-02-01
biz:research  .... ..
fos:hledger   .... .... ....
fos:ledger    0.25
fos:haskell   .5
inc:client1   2

CSV (SSV, TSV) is the most compact format. Here's a one-line-per-day TSV setup with hledger:

# a.tsv
2022-01-01  2   1.5 2.5
2022-01-02  0   3   0
# a.tsv.rules
skip 1
fields date, work, rest, play
amount1  %work h
amount2  %rest h
amount3  %play h
account1 (time:work)
account2 (time:rest)
account3 (time:play)
$ hledger -f a.tsv bal -D

See also


(c) 2016-2024 Simon Michael & contributors | Send updates via github