help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to get hours from hh:mm


From: Alexis Roda
Subject: Re: How to get hours from hh:mm
Date: Thu, 14 Jun 2007 21:06:31 +0200
User-agent: Mozilla Thunderbird 1.5.0.10 (X11/20070221)

En/na Pascal Bourguignon ha escrit:
Cecil Westerhof <dummy@dummy.nl> writes:

Pascal Bourguignon wrote:

Cecil Westerhof <dummy@dummy.nl> writes:

I have a table in org-mode with time needed to travel from A to B an the
number of km. I would like to get the average speed. How do I convert a
time? For example 0:45 becomes 0.75.
How do you know that 0:45 becomes 0.75?

How did you do it?
I did not. I want. 0:45 is three quarters of an hour, so in mathematical
notation 0.75.

Something like this could be helpful:

(defun time100(time)
  (let ((timelist (split-string time ":")))
    (+ (string-to-number (car timelist))
       (/ (string-to-number (cadr timelist))
          60.0))))


HTH




reply via email to

[Prev in Thread] Current Thread [Next in Thread]