2015-10-20 16:26:09 +03:00
2020-07-05 02:17:13 +03:00
.TH "hledger_timeclock" "5" "July 2020" "hledger 1.18.99" "hledger User Manuals"
2015-10-20 16:26:09 +03:00
.SH NAME
.PP
2019-05-24 08:26:43 +03:00
Timeclock - the time logging format of timeclock.el, as read by hledger
2015-10-20 16:26:09 +03:00
.SH DESCRIPTION
.PP
2016-04-13 07:10:02 +03:00
hledger can read timeclock files.
2019-01-25 02:37:40 +03:00
As with Ledger, these are (a subset of) timeclock.el\[ aq]s format,
2019-05-24 08:26:43 +03:00
containing clock-in and clock-out entries as in the example below.
2016-05-28 22:58:30 +03:00
The date is a simple date.
2019-05-24 08:26:43 +03:00
The time format is HH:MM[:SS][+-ZZZZ].
2015-10-20 16:26:09 +03:00
Seconds and timezone are optional.
The timezone, if present, must be four digits and is ignored (currently
the time is always interpreted as a local time).
.IP
.nf
\f[C]
2019-05-24 08:26:43 +03:00
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
\f[R]
2015-10-20 16:26:09 +03:00
.fi
.PP
2019-05-24 08:26:43 +03:00
hledger treats each clock-in/clock-out pair as a transaction posting
2015-10-20 16:26:09 +03:00
some number of hours to an account.
Or if the session spans more than one day, it is split into several
transactions, one for each day.
2019-05-24 08:26:43 +03:00
For the above time log, \f[C]hledger print\f[R] generates these journal
2015-10-20 16:26:09 +03:00
entries:
.IP
.nf
\f[C]
2019-05-24 08:26:43 +03:00
$ hledger -f t.timeclock print
2020-01-21 05:02:42 +03:00
2015-03-30 * optional description after two spaces
2019-05-24 08:26:43 +03:00
(some:account name) 0.33h
2015-10-20 16:26:09 +03:00
2020-01-21 05:02:42 +03:00
2015-03-31 * 22:21-23:59
2019-05-24 08:26:43 +03:00
(another account) 1.64h
2015-10-20 16:26:09 +03:00
2020-01-21 05:02:42 +03:00
2015-04-01 * 00:00-02:00
2019-05-24 08:26:43 +03:00
(another account) 2.01h
\f[R]
2015-10-20 16:26:09 +03:00
.fi
.PP
2016-04-13 07:10:02 +03:00
Here is a sample.timeclock to download and some queries to try:
2015-10-20 16:26:09 +03:00
.IP
.nf
\f[C]
2019-05-24 08:26:43 +03:00
$ 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
\f[R]
2015-10-20 16:26:09 +03:00
.fi
.PP
To generate time logs, ie to clock in and clock out, you could:
.IP \[ bu] 2
2019-05-24 08:26:43 +03:00
use emacs and the built-in timeclock.el, or the extended timeclock-x.el
and perhaps the extras in ledgerutils.el
2015-10-20 16:26:09 +03:00
.IP \[ bu] 2
at the command line, use these bash aliases:
2020-01-05 18:04:00 +03:00
\f[C]shell alias ti=\[dq]echo i \[ga]date \[aq]+%Y-%m-%d %H:%M:%S\[aq]\[ga] \[rs]$* >>$TIMELOG\[dq] alias to=\[dq]echo o \[ga]date \[aq]+%Y-%m-%d %H:%M:%S\[aq]\[ga] >>$TIMELOG\[dq]\f[R]
2015-10-20 16:26:09 +03:00
.IP \[ bu] 2
2019-05-24 08:26:43 +03:00
or use the old \f[C]ti\f[R] and \f[C]to\f[R] scripts in the ledger 2.x
2015-10-20 16:26:09 +03:00
repository.
2019-05-24 08:26:43 +03:00
These rely on a \[ dq]timeclock\[ dq] executable which I think is just the
ledger 2 executable renamed.
2015-10-20 16:26:09 +03:00
.SH "REPORTING BUGS"
2016-04-09 23:56:09 +03:00
Report bugs at http://bugs.hledger.org
(or on the #hledger IRC channel or hledger mail list)
2015-10-20 16:26:09 +03:00
.SH AUTHORS
2016-04-09 23:56:09 +03:00
Simon Michael <simon@joyful.com> and contributors
2015-10-20 16:26:09 +03:00
.SH COPYRIGHT
2019-09-13 18:26:49 +03:00
Copyright (C) 2007-2019 Simon Michael.
2015-10-20 16:26:09 +03:00
.br
2016-04-13 06:31:17 +03:00
Released under GNU GPL v3 or later.
2015-10-20 16:26:09 +03:00
.SH SEE ALSO
2016-04-09 23:56:09 +03:00
hledger(1), hledger\- ui(1), hledger\- web(1), hledger\- api(1),
2016-04-13 07:10:02 +03:00
hledger_csv(5), hledger_journal(5), hledger_timeclock(5), hledger_timedot(5),
2016-04-09 23:56:09 +03:00
ledger(1)
2015-10-20 16:26:09 +03:00
2016-04-09 23:56:09 +03:00
http://hledger.org