Jump to content

Time math with a starting time that is NOT now

Recommended Posts

Welcome @timrosenberg,


Processes which allow you to make calculations on time typically require that you be specific with the date. That is to say you wouldn’t do 9:00 + 4h but March 10 2022 at 9:00 + 4h (consider what happens when it goes over to the next day; it has to be represented).

If you only want to add hours, you’re looking at simple arithmetic: (9 + 4) % 24. The % is the modulo operator. Doing it on 24 will make it “flip over” according to a 24h clock (example: (17 + 9) % 24 = 2 or “5PM plus 9 hours equals 2AM”). You can try these in Alfred’s main window by starting with = then typing the operation.

If you want to use this in a Workflow, you’ll have to be more specific in your request. Right now it’s so broad it approximates an XY problem so there’s yet no way to know what the best answer is.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...