1

How do I use calc to add a time interval to a moment in time (i.e., a date, or a time)?

For instance, say I want to know what the time and day will be 8,000 minutes into the future?

I know that t N will push the current moment onto the stack. And I know that I can enter a small, HMS-normalized interval like 10 minutes by typing 0@10'0" (for zero hours, ten minutes, and zero seconds), and that I can then add them by typing +.

But this isn't very useful if I want to add arbitrary time intervals specified by combinations of days, hours, minutes, and seconds that have not been normalized. Sadly calc throws an error of "Bad Format" if you try to enter an interval like 0@8000'0" to represent 8,000 minutes.

Does calc mode itself have a facility for entering, non-normalized time intervals?

4

To input a value in non-standardized HMS form you can press ' to start algebraic entry and then use the hms function. For example, to enter the equivalent of 0@8000'0" you would type ' hms(0, 8000, 0) RET.

Another possibility is to input the number of days and then convert them to HMS form using the function calc-to-hms (bound to ch). So for your example you would type 8000 RET 60 RET / ch.

Note that adding float or integer values to HMS forms interprets these values as hours whereas doing this for date forms interprets these values as days.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.