hledger_timeclock(5)
π hledger_timeclock β bestie's guide to the timeclock format π
okay so this is the manual page for hledger_timeclock(5), part of the hledger user manuals, and it's all about the time logging format of timeclock.el, as read by hledger. yes bestie, we're logging our hours like it's a diary entry but make it β¨accountingβ¨.
πΈ NAME πΈ
Timeclock β the time logging format of timeclock.el, as read by hledger. periodt.
β¨ DESCRIPTION β¨
so hledger can read timeclock files, no cap. just like with Ledger, these files are (a subset of) timeclock.el's format, and they hold clock-in and clock-out entries like the ones in the example down below. the date is a plain simple date. the time format is HH:MM[:SS][+-ZZZZ] β seconds and the timezone are optional, so you can be chill about them. the timezone, if you do include it, has to be four digits and it gets ignored (currently the time is always interpreted as a local time, so don't come for me about your world clock π).
i 2015/03/30 09:00:00 some:account name optional description after two spaces
o 2015/03/30 09:20:00
i 2015/03/31 22:21:45 another account
o 2015/04/01 02:00:34
hledger treats each clock-in/clock-out pair as a transaction posting some number of hours to an account. the way that works is so satisfying honestly. and if the session spans more than one day, it gets split into several transactions, one for each day β it's giving responsible bookkeeping. π
for the time log above, hledger print generates these journal entries:
$ hledger -f t.timeclock print
2015-03-30 * optional description after two spaces
(some:account name) 0.33h
2015-03-31 * 22:21-23:59
(another account) 1.64h
2015-04-01 * 00:00-02:00
(another account) 2.01h
here is a sample.timeclock to download and some queries to try, bestie, go off:
$ hledger -f sample.timeclock balance # current time balances
$ hledger -f sample.timeclock register -p 2009/3 # sessions in march 2009
$ hledger -f sample.timeclock register -p weekly --depth 1 --empty # time summary by week
to generate time logs, ie to clock in and clock out, you could:
- use emacs and the built-in
timeclock.el, or the extendedtimeclock-x.eland perhaps the extras inledgerutils.elβ emacs girlies rise up π - at the command line, use these bash aliases:
alias ti="echo i `date '+%Y-%m-%d %H:%M:%S'` \$* >>$TIMELOG"
alias to="echo o `date '+%Y-%m-%d %H:%M:%S'` >>$TIMELOG"
- or use the old
tiandtoscripts in the ledger 2.x repository. these rely on a"timeclock"executable which I think is just the ledger 2 executable renamed. iconic honestly.
π«Ά REPORTING BUGS π«Ά
report bugs at http://bugs.hledger.org (or on the #hledger IRC channel or hledger mail list). we wanna hear it, fr fr. π
π AUTHORS π
Simon Michael <simon@joyful.com> and contributors. shoutout to the contributors, they ate. π
π COPYRIGHT π
Copyright (C) 2007-2019 Simon Michael. Released under GNU GPL v3 or later.
π₯ SEE ALSO π₯
hledger(1), hledger-ui(1), hledger-web(1), hledger-api(1), hledger_csv(5), hledger_journal(5), hledger_timeclock(5), hledger_timedot(5), ledger(1)
okay that's the whole vibe check, bestie β this was hledger 1.18.99, dated September 2020, and it's the hledger_timeclock(5) page from the hledger User Manuals. now go clock in, you main character π¦β¨
π¦ where this page comes from
- ubuntu jammy: hledger 1.19.1-1 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms