Is there a built-in way to convert/toggle between GNU Emacs Calc's HMS forms and seconds? I'd also like to easily be able to add numbers as seconds and/or minutes to an existing HMS form.
-
Please specify what you mean by "HMS form". Do you mean a list of numbers? A formatted time string? The question is unclear so far, and so risks being closed.– DrewCommented Mar 6, 2018 at 5:22
-
Depending on what you mean by your question, see the Elisp manual, node Time Parsing or other time-related nodes under node System Interface.– DrewCommented Mar 6, 2018 at 5:24
Add a comment
|
1 Answer
One way of going from an HMS form to the number of seconds is hinted by a line from the HMS forms page:
Dividing two HMS forms produces a real-valued ratio of the two angles.
So if an HMS form is on the stack
5@ 30' 0"
entering one second to the stack
1"
and dividing by it
/
gives the number of seconds:
19800.
Not exactly a convert but it's only three keystrokes.