DCDawg Posted June 15, 2020 Share Posted June 15, 2020 Although I am relatively new to Alfred's PowerPack, I have been using the heck out of Snippets--especially since I was a TextExpander user. However, it would be great to have more Date calculation capabilities. For example, if I want to write an email that says your response is due next Friday, I would love to have something like {date +Friday} as a way to say replace this with the date for next Friday. Just a thought. Link to comment Share on other sites More sharing options...
Terminal Posted June 23, 2020 Share Posted June 23, 2020 (edited) This is possible with a snippet workflow. With this example you can set a workflow variable to control the date format import os import datetime env = os.environ date_format = env.get('date_format', '%Y-%m-%d') d = datetime.date.today() while d.weekday() != 4: d += datetime.timedelta(1) print d.strftime(date_format), Edited June 23, 2020 by Terminal Link to comment Share on other sites More sharing options...
deanishe Posted June 23, 2020 Share Posted June 23, 2020 4 hours ago, Terminal said: env = os.environ date_format = env.get('date_format', '%Y-%m-%d') os.getenv()? Terminal 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now