Small utility for tracking working hours in a plain text file
git clone https://git.8pit.net/tracktime.git
1# tracktime 2 3Small utility for tracking working hours in a plain text file. 4 5## Usage 6 7Tracking working hours is complicated as one usually has to consider 8holidays and vacations for determining required working hours. This tool 9takes a different approach by assuming that one has to work the same10amount of hours on each tracked day. Based on this assumption, the tool11calculates a delta between all tracked workdays to determine the current12overtime.1314For instance, if one has to work 8 hours each day and worked 9 hours on15the 6th of January only 7 hours of work would be required on the 7th of16January:1718 $ cat ~/.tracktime19 06.01.2020 0900 1800 Important work stuff20 07.01.2020 1000 1700 More important work stuff21 $ tracktime -h 8 ~/.tracktime22 06.01.2020 9h0m0s | 1h0m0s23 07.01.2020 7h0m0s | 0s2425The last column of the `tracktime` output represents the described26delta. In this example, it is zero on the 7th of January even though27only 7 hours of work were done. The overtime done on the 6th of January28is used to compensate for the shortage.2930## Input format3132The input format uses four tab-separated fields. The fields have the33following meaning:34351. Workday. Multiple entries for the same day are allowed. The36 utilized date format can be customized using the `TRACKTIME_FORMAT`37 environment variable. Refer to the documentation of the38 [Go time pkg](https://golang.org/pkg/time/#pkg-constants) for more39 information.402. Starting time of the described activity without a hours/minutes41 separator and padded with zeros to four digits.423. End time of the described activity.434. Description of the activity.4445A parser for the input format is available in the `parser/`46subdirectory. The parser can be imported as a Go library to write custom47tooling, e.g. format conversion tools for importing data into existing48time tracking systems.4950## Installation5152No dependencies, simply use `go get`:5354 $ go get github.com/nmeum/tracktime5556Additional utilities are available in the `contrib/` directory and can57be installed separately, also through `go get`.5859## License6061This program is free software: you can redistribute it and/or modify it62under the terms of the GNU General Public License as published by the63Free Software Foundation, either version 3 of the License, or (at your64option) any later version.6566This program is distributed in the hope that it will be useful, but67WITHOUT ANY WARRANTY; without even the implied warranty of68MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General69Public License for more details.7071You should have received a copy of the GNU General Public License along72with this program. If not, see <http://www.gnu.org/licenses/>.