search file date range without year ?

Discussion related to "Everything" 1.5 Alpha.
Post Reply
anmac1789
Posts: 669
Joined: Mon Aug 24, 2020 1:16 pm

search file date range without year ?

Post by anmac1789 »

Hello everyone, How do I search for date modified date range without the year ? For example dm:11..03 (November to march of any year)
NotNull
Posts: 5461
Joined: Wed May 24, 2017 9:22 pm

Re: search file date range without year ?

Post by NotNull »

For any year:

Code: Select all

dm-month:march..november
For the current year (2023):

Code: Select all

dm:march..november
anmac1789
Posts: 669
Joined: Mon Aug 24, 2020 1:16 pm

Re: search file date range without year ?

Post by anmac1789 »

NotNull wrote: Fri Nov 03, 2023 8:52 pm For any year:

Code: Select all

dm-month:march..november
For the current year (2023):

Code: Select all

dm:march..november
What if I wanted to search for month and day without year ?
NotNull
Posts: 5461
Joined: Wed May 24, 2017 9:22 pm

Re: search file date range without year ?

Post by NotNull »

Take a look at the Search Functions and you will find the dm-day function and similar, including examples.
void
Developer
Posts: 16745
Joined: Fri Oct 16, 2009 11:31 pm

Re: search file date range without year ?

Post by void »

Would the following be helpful:

dm-month:march..november dm-day:14..21



or do you need a specific date on March to a specific date in November?
-I don't have an easy way to do this.
You'll have to setup a "datevalue" and then search that.

For example:

14th of March until the 21st November:

addcolumn:a a:=DAY($dm:)+(MONTH($dm:)*32) $a:>=14+(3*32) $a:<=21+(11*32)

where:
14 is the first day.
3 is the first month.
21 is the last day.
11 is the last month.
anmac1789
Posts: 669
Joined: Mon Aug 24, 2020 1:16 pm

Re: search file date range without year ?

Post by anmac1789 »

void wrote: Fri Nov 03, 2023 11:37 pm Would the following be helpful:

dm-month:march..november dm-day:14..21



or do you need a specific date on March to a specific date in November?
-I don't have an easy way to do this.
You'll have to setup a "datevalue" and then search that.

For example:

14th of March until the 21st November:

addcolumn:a a:=DAY($dm:)+(MONTH($dm:)*32) $a:>=14+(3*32) $a:<=21+(11*32)

where:
14 is the first day.
3 is the first month.
21 is the last day.
11 is the last month.
Basically, I'm looking to search DST months every year in EDT/EST timezones
1. Winter timezones - first sunday in november to 2nd sunday in march next following year
2. summer timezones - second sunday in march to first sunday in november of the same year
Last edited by anmac1789 on Sat Nov 04, 2023 8:00 am, edited 1 time in total.
void
Developer
Posts: 16745
Joined: Fri Oct 16, 2009 11:31 pm

Re: search file date range without year ?

Post by void »

The following might be easier:

FORMATFILETIME($dm:)==FORMATFILETIMEUTC($dm:+(10.5*36000000000))

where 10.5 is your day light savings UTC offset.

This will list files modified during day light savings.

Use != to invert the results.
anmac1789
Posts: 669
Joined: Mon Aug 24, 2020 1:16 pm

Re: search file date range without year ?

Post by anmac1789 »

void wrote: Sat Nov 04, 2023 7:57 am The following might be easier:

FORMATFILETIME($dm:)==FORMATFILETIMEUTC($dm:+(10.5*36000000000))

where 10.5 is your day light savings UTC offset.

This will list files modified during day light savings.

Use != to invert the results.
How does this work because for DST, it depends on EST/EDT,

EST: First Sunday in November to second Sunday in March
EDT: Second Sunday in March to first Sunday in November
void
Developer
Posts: 16745
Joined: Fri Oct 16, 2009 11:31 pm

Re: search file date range without year ?

Post by void »

This just matches files where the date modified in local time is the same as the date modified in UTC + some offset (10.5 hours in this case).

Date modified is stored in Everything in UTC.
UTC doesn't have daylight savings.
Converting to local time will apply any daylight saving offsets.
The system does this conversion (not Everything).

FORMATFILETIME() will apply daylight saving offsets.
FORMATFILETIMEUTC() does not apply daylight saving offsets.

Adjust the +10.5 hours to match the desired daylight saving offset.
Post Reply