Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] Days since/in X days #11

Closed
kirillbobyrev opened this issue Dec 14, 2021 · 4 comments
Closed

[Feature request] Days since/in X days #11

kirillbobyrev opened this issue Dec 14, 2021 · 4 comments

Comments

@kirillbobyrev
Copy link

Thank you for an interesting tool!

I was wondering if the following use-case would be interesting to you: I frequently want to know how much days have passed since a certain date or what would be the date + x days. IIUC, I can already calculate now + x days through 4 pm in x days but I can't do the same for the future and the past. It would certainly be nice to me since that's something I frequently do to calculate some documents processing time, etc.

@yerke
Copy link

yerke commented Dec 16, 2021

AFAIK days is not supported. Only hours is. The only working format so far is when "2 days ago in utc". when "now + 2 hours" doesn't work.

@kirillbobyrev
Copy link
Author

kirillbobyrev commented Dec 16, 2021

AFAIK days is not supported. Only hours is. The only working format so far is when "2 days ago in utc". when "now + 2 hours" doesn't work.

It certainly is: https://mitsuhiko.github.io/when/?input=now+in+2+days+in+munich

Also, the README has

2pm in 2 days in new delhi

@mitsuhiko
Copy link
Owner

It now outputs the difference of the timestamp to the current point in time:

$ when '4pm in sfo'
time: 16:00:00 (in 13 hours and 43 minutes; afternoon)
date: 2021-12-16 (Thursday)
zone: America/Los_Angeles (PST; -0800)
location: San Francisco International Airport (CA; United States)

time: 01:00:00 (in 13 hours and 43 minutes; night)
date: 2021-12-17 (Friday)
zone: Europe/Vienna (CET; +0100)

@mitsuhiko
Copy link
Owner

On second thought this could just be a line at the end summarizing this. This just also fit will into the JSON array being returned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants