Add Date Constant: "now"

Have a suggestion for "Everything"? Please post it here.
Post Reply
raccoon
Posts: 1017
Joined: Thu Oct 18, 2018 1:24 am

Add Date Constant: "now"

Post by raccoon »

Per the Search Syntax wrote:Date Constants:
today
yesterday
tomorrow
<last|past|prev|current|this|coming|next><year|month|week>
<last|past|prev|coming|next><x><years|months|weeks|days|hours|minutes|mins|seconds|secs>
january|february|march|april|may|june|july|august|september|october|november|december
jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec
sunday|monday|tuesday|wednesday|thursday|friday|saturday
sun|mon|tue|wed|thu|fri|sat
unknown
I wish to suggest adding the constant "now" which is similar to "today" but is accurate to the current minute or the current second (probably minute). The constant "today" presumably includes all results from midnight to midnight today, but "now" would only display files that were created or modified at this very moment. Example:

dm:<=now -- displays all files with a modified time of this minute or older, ignoring erroneous future-dated files exactly.
NotNull
Posts: 5458
Joined: Wed May 24, 2017 9:22 pm

Re: Add Date Constant: "now"

Post by NotNull »

You can already use something like

Code: Select all

dm:<last1seconds
or even dm:<last0seconds


Note: Those date constants work like a variable: they are set once when the query is executed and not updated.
It is expanded to a (static) date-range (at least: that's how I imagine the inner workings)
You have to re-execute that query to update it.

Example:
if you query dm:today on 22 October 23:59, that will give you the files modified on 22 October.
On 23 October 00:01 it will still give you the files modified on 22 October.
raccoon
Posts: 1017
Joined: Thu Oct 18, 2018 1:24 am

Re: Add Date Constant: "now"

Post by raccoon »

Yes, I just discovered this as I had the query dm:<=today up and it stalled at midnight.

I wonder if it would be feasible or reasonable to have these constants update when the clock rolls over, ie, every midnight (today) or every minute (now).
NotNull
Posts: 5458
Joined: Wed May 24, 2017 9:22 pm

Re: Add Date Constant: "now"

Post by NotNull »

Feasible: probably
Reasonable: No. I would get really annoyed when during analyzing results, they would suddenly (dis)appear.

Just use rc: instead.

(My 2 cents)
raccoon
Posts: 1017
Joined: Thu Oct 18, 2018 1:24 am

Re: Add Date Constant: "now"

Post by raccoon »

Honestly never used recentchanged:, is that looking at files with a dm: and dc: of a given date (default today)? similarly has to be reentered at midnight? I'm fine with that, just never used that func.
NotNull
Posts: 5458
Joined: Wed May 24, 2017 9:22 pm

Re: Add Date Constant: "now"

Post by NotNull »

Whereas the other date function give you a snapshot ("photo"), rc: will constantly update itself ("movie").
Just try it; that will probably explain it much better tahn I can :)
Post Reply