* Add or subtract times in an org-table
@ 2013-02-12 8:30 Bastian Bechtold
2013-02-12 8:54 ` Bastien
0 siblings, 1 reply; 3+ messages in thread
From: Bastian Bechtold @ 2013-02-12 8:30 UTC (permalink / raw)
To: help-gnu-emacs
Hi,
I am an enthusiastic user of org-mode for organizing my work and
clocking my work time.
At the end of each week, I use org-agenda to view a summary of what I
worked on that week and how long I worked per project and in total. This
is great!
Then, I put this into an org-table that sums up the time I worked
against my quota like this:
| week | time | quota | diff | overtime | comments |
|------+-------+-------+-------+----------+------------------------|
| W01 | 11:45 | 12:00 | -0:15 | -0:15 | |
| W02 | 14:30 | 12:00 | 1:30 | 1:15 | |
| W03 | 9:00 | 9:36 | -0:36 | 0:39 | sick on friday (-2:24) |
Where the second column is the time I actually worked, the third column
is the time I should have worked, the fourth column is the difference
between the second and the third (i.e. overtime), and the fifth column
sums up the overtime over time.
The thing is, I do all this by hand because I can't figure out how to
add or subtract times in emacs.
Could any of you emacs wizards help me with that? Any hints would be
appreciated!
Kind regards,
Bastian
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Add or subtract times in an org-table
2013-02-12 8:30 Add or subtract times in an org-table Bastian Bechtold
@ 2013-02-12 8:54 ` Bastien
2013-02-12 9:52 ` Bastian Bechtold
0 siblings, 1 reply; 3+ messages in thread
From: Bastien @ 2013-02-12 8:54 UTC (permalink / raw)
To: bastian.bechtold; +Cc: help-gnu-emacs
Hi Bastian,
Bastian Bechtold <emacs@bastibe.de> writes:
> The thing is, I do all this by hand because I can't figure out how to
> add or subtract times in emacs.
See the formula at the bottom of this table:
| week | time | quota | diff | overtime | comments |
|------+----------+-------+-------+----------+------------------------|
| W01 | 11:45 | 12:00 | -0:15 | -0:15 | |
| W02 | 14:30 | 12:00 | 1:30 | 1:15 | |
| W03 | 9:00 | 9:36 | -0:36 | 0:39 | sick on friday (-2:24) |
|------+----------+-------+-------+----------+------------------------|
| | 35:15:00 | | | | |
#+TBLFM: @5$2=vsum(@2..@4);T
You can check this info node:
(info "(org)Durations and time values")
> Could any of you emacs wizards help me with that? Any hints would be
> appreciated!
HTH,
--
Bastien
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Add or subtract times in an org-table
2013-02-12 8:54 ` Bastien
@ 2013-02-12 9:52 ` Bastian Bechtold
0 siblings, 0 replies; 3+ messages in thread
From: Bastian Bechtold @ 2013-02-12 9:52 UTC (permalink / raw)
To: Bastien; +Cc: help-gnu-emacs
Hi Bastien,
thank you very much for that answer! It pointed me in the perfect
direction and allowed me to solve my problem.
For the record, my solution is
| week | time | quota | diff | overtime | comments |
|------+-------+-------+-----------+-----------+------------------------|
| W01 | 11:45 | 12:00 | -00:15:00 | -00:15:00 | |
| W02 | 14:30 | 12:00 | 02:30:00 | 02:15:00 | |
| W03 | 9:00 | 9:36 | -00:36:00 | 01:39:00 | sick on friday (-2:24) |
#+TBLFM: $4=$2-$3;T::$5=@-1+$-1;T
Which calculates the correct results, albeit with some useless ':00'
seconds appended to every calculation.
Still, this solves my problem.
Thank you very much,
Bastian
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-02-12 9:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-12 8:30 Add or subtract times in an org-table Bastian Bechtold
2013-02-12 8:54 ` Bastien
2013-02-12 9:52 ` Bastian Bechtold
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.