Time tracking: time formatting and hourly rates

88 views
Skip to first unread message

Carl Tappan

unread,
May 25, 2022, 12:48:02 PM5/25/22
to Ledger
Hi,

I'm trying to set up a minimal time tracking system with ledger and have two questions.

1.) Is it possible to enter time in "HH:MM" format? Converting to decimal hours is clunky, and the various timeclock options don't fit my workflow well. I know that I can add a timelog entry with "time in" and "time out", but ideally I'd be able to post directly to the account.

2.) Is it possible to define an hourly rate in a price history file, or some other persistent way that doesn't require recording each entry as xx.yyh @ $<rate> ? The documentation implies under 3.4.2 that time is just a commodity, but setting a price as P h $<rate> doesn't seem to work. If I log in units of 'hours' instead of 'h' then defining P hour $<rate> works as expected, but I think that breaks the predefined equivalencies between different time units.

Thanks for any advice, and sorry if this I missed this somewhere in the docs or discussion history.

Best,
Carl

John Wiegley

unread,
May 25, 2022, 2:43:44 PM5/25/22
to Carl Tappan, Ledger
>>>>> "CT" == Carl Tappan <ca...@carltappan.com> writes:

CT> 1.) Is it possible to enter time in "HH:MM" format? Converting to decimal
CT> hours is clunky, and the various timeclock options don't fit my workflow
CT> well. I know that I can add a timelog entry with "time in" and "time out",
CT> but ideally I'd be able to post directly to the account.

You won't be able to use such a syntax to express durations of time, but what
you COULD do is use the format you'd like and then write a processing script
to convert those HH:MM entries into seconds.

CT> 2.) Is it possible to define an hourly rate in a price history file, or
CT> some other persistent way that doesn't require recording each entry as
CT> xx.yyh @ $<rate> ? The documentation implies under 3.4.2 that time is just
CT> a commodity, but setting a price as P h $<rate> doesn't seem to work. If I
CT> log in units of 'hours' instead of 'h' then defining P hour $<rate> works
CT> as expected, but I think that breaks the predefined equivalencies between
CT> different time units.

Price histories work differently from associating a conversion value with a
posting. I don't think the "P" directive will ever fully do what you'd wish
here.

John

Colin Dean

unread,
May 25, 2022, 2:48:49 PM5/25/22
to Ledger
I've used timetracking mode extensively for about a decade now. I'm always learning new things about ledger but I feel I've got a lot of experience with that particular mode because I've been using it to track my time for more than half of my professional life ;-)

Unfortunately, you have to enter the time in fill HH:MM:SS. I've not found an option that enables eliding the seconds.

JW will probably respond with input on the latter.

Carl Tappan

unread,
May 26, 2022, 6:21:27 AM5/26/22
to Ledger
Thanks folks, sounds like preprocessing is the way to go. Easy enough, I just didn't want to reinvent the wheel.
Carl
Reply all
Reply to author
Forward
0 new messages