summaryrefslogtreecommitdiff
path: root/hledger_timeclock.txt
blob: 175b293660b180bde115ce785c95c64f809e9c4b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80

HLEDGER_TIMECLOCK(5)         hledger User Manuals         HLEDGER_TIMECLOCK(5)



NAME
       The time logging format of timeclock.el, as read by hledger.

DESCRIPTION
       hledger  can read timeclock files.  As with Ledger, these are (a subset
       of) timeclock.el's format, containing clock-in and clock-out entries as
       in  the  example below.  The date is a simple date.  The time format is
       HH:MM[:SS][+-ZZZZ].  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).

              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.  Or if the session spans more than
       one day, it is split into several transactions, one for each day.   For
       the above time log, 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:

              $ 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:

       o use  emacs  and the built-in timeclock.el, or the extended timeclock-
         x.el and perhaps the extras in ledgerutils.el

       o at the command line, use these bash aliases: shell     alias ti="echo
         i  `date  '+%Y-%m-%d  %H:%M:%S'` \$* >>$TIMELOG"     alias to="echo o
         `date '+%Y-%m-%d %H:%M:%S'` >>$TIMELOG"

       o or use the old ti and to scripts in the ledger 2.x repository.  These
         rely  on  a "timeclock" executable which I think is just the ledger 2
         executable renamed.



REPORTING BUGS
       Report bugs at http://bugs.hledger.org (or on the #hledger IRC  channel
       or hledger mail list)


AUTHORS
       Simon Michael <simon@joyful.com> and contributors


COPYRIGHT
       Copyright (C) 2007-2020 Simon Michael.
       Released under GNU GPL v3 or later.


SEE ALSO
       hledger(1), hledger-ui(1), hledger-web(1), ledger(1)

       hledger_journal(5), hledger_csv(5), hledger_timeclock(5), hledger_time-
       dot(5)



hledger-lib-1.20.4               December 2020            HLEDGER_TIMECLOCK(5)