DST times not showing dm: times with 2 AM

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

DST times not showing dm: times with 2 AM

Post by anmac1789 »

Everything isn't viewing DST times properly. For example, in 2024, EST switches to EDT in East Coast North America at March 10, 2024 @ 2 AM (second Sunday of the month)

image.png
image.png (194.35 KiB) Viewed 4889 times

The results show date modified times with 1 AM when it should show times with 2 AM. How to fix this ? What is going on here ?

Also, how can I show files with date modified times of (1st sunday, 2nd sunday of x month) ?
void
Developer
Posts: 17152
Joined: Fri Oct 16, 2009 11:31 pm

Re: DST times not showing dm: times with 2 AM

Post by void »

Does Everything match the date modified timestamp from Windows Explorer?

To find date modified on the first Sunday:
WEEKDAY($dm:)+(((DAY($dm:)-1)/7)*7)==0


To find date modified on the second Sunday:
WEEKDAY($dm:)+(((DAY($dm:)-1)/7)*7)==7
anmac1789
Posts: 680
Joined: Mon Aug 24, 2020 1:16 pm

Re: DST times not showing dm: times with 2 AM

Post by anmac1789 »

void wrote: Sun Sep 29, 2024 10:51 pm Does Everything match the date modified timestamp from Windows Explorer?

To find date modified on the first Sunday:
WEEKDAY($dm:)+(((DAY($dm:)-1)/7)*7)==0


To find date modified on the second Sunday:
WEEKDAY($dm:)+(((DAY($dm:)-1)/7)*7)==7
How do I find any windows explorer files with date modified around 2 AM on March 10 when I use everything to find those types of files ? lol
void
Developer
Posts: 17152
Joined: Fri Oct 16, 2009 11:31 pm

Re: DST times not showing dm: times with 2 AM

Post by void »

2am-3am doesn't exist on this day.
Windows converts 2am-3am to 1am-2am


Everything converts your search dm:2024-03-10T02 to a filetime for comparison.
The date modified search starts at 2024-03-10T02 with a one-hour range.
However, due to the filetime conversion, this ends up searching for:
dm:>=2024-03-10T01 with a one-hour range



Please try the following search instead:

dm:2024-03-10 dmhour:2


This shouldn't match anything as this hour doesn't exist on this day.



-or-


Search for a larger range and sort by date modified:

dm:2024-03-10T01..2024-03-10T04
anmac1789
Posts: 680
Joined: Mon Aug 24, 2020 1:16 pm

Re: DST times not showing dm: times with 2 AM

Post by anmac1789 »

void wrote: Sun Sep 29, 2024 10:51 pm Does Everything match the date modified timestamp from Windows Explorer?

To find date modified on the first Sunday:
WEEKDAY($dm:)+(((DAY($dm:)-1)/7)*7)==0


To find date modified on the second Sunday:
WEEKDAY($dm:)+(((DAY($dm:)-1)/7)*7)==7
What does the
==0
and
==7
do?
void
Developer
Posts: 17152
Joined: Fri Oct 16, 2009 11:31 pm

Re: DST times not showing dm: times with 2 AM

Post by void »

== means compare

0 is the first Sunday.
7 is the second Sunday.
anmac1789
Posts: 680
Joined: Mon Aug 24, 2020 1:16 pm

Re: DST times not showing dm: times with 2 AM

Post by anmac1789 »

void wrote: Mon Sep 30, 2024 3:40 am == means compare

0 is the first Sunday.
7 is the second Sunday.
== does this make the expression equal to 0 or 7 ? How does that function work ? whats the logic?

Also, is there an easier way to combine all these searches:

"beginning of the year until 2nd Sunday of March of any given x year" = EST (standard time) (DST off)

"From 2nd Sunday of March until 1st Sunday of November of any given x year" = EDT (daylight time) (DST on)

"1st Sunday of November until the end of any given x year" = EST (standard time) (DST off)
Herkules97
Posts: 78
Joined: Tue Oct 08, 2019 6:42 am

Re: DST times not showing dm: times with 2 AM

Post by Herkules97 »

It's somewhat been covered already, but EBV uses filetime internally if I understand it correctly.
This is then converted to a user-friendly version or..something.
You can see this in Everything by looking at a time range of say 01-03. It may jump from 01 to 02 or 01 to 03.
It will jump back around October, I believe 27th but I cba to look it up again.
Something similar happened in my foobar2000, I think it also uses the same filetime system internally. At least Playback Statistics exports in it.

Fun? fact, it currently starts with 1337.
anmac1789
Posts: 680
Joined: Mon Aug 24, 2020 1:16 pm

Re: DST times not showing dm: times with 2 AM

Post by anmac1789 »

Herkules97 wrote: Mon Sep 30, 2024 9:16 am It's somewhat been covered already, but EBV uses filetime internally if I understand it correctly.
This is then converted to a user-friendly version or..something.
You can see this in Everything by looking at a time range of say 01-03. It may jump from 01 to 02 or 01 to 03.
It will jump back around October, I believe 27th but I cba to look it up again.
Something similar happened in my foobar2000, I think it also uses the same filetime system internally. At least Playback Statistics exports in it.

Fun? fact, it currently starts with 1337.
I'm sorry I'm a bit lost. Could you explain in easier terms for a 5 year old lol
void
Developer
Posts: 17152
Joined: Fri Oct 16, 2009 11:31 pm

Re: DST times not showing dm: times with 2 AM

Post by void »

Everything will evaluate the expression when using $dm: in your search.

When the expression evaluates as true the result is added.
When the expression evaluates as false the result is not added.

The following will evaluate as true:
1==1
7==7
( == is equal to )

The following will evaluate as false:
1==0
0==7
1==7



It might be easier to see how
WEEKDAY($dm:)+(((DAY($dm:)-1)/7)*7)==0
works by showing these values in a temporary column.

Please try including the following search:

addcolumn:a a:=WEEKDAY($dm:)


The week day as a number is shown in column A
(Everything is incorrectly using the Windows week day numbers 0=Sunday, I will switch this to Excel format 1=Sunday in the next alpha update)



To view the week, please try including the following in your search:

addcolumn:a a:=((DAY($dm:)-1)/7)


The first week will be 0, then second week 1, etc...



If you multiply the week by 7 and add the weekday you can work out the first Sunday, second Sunday etc..

addcolumn:a a:=WEEKDAY($dm:)+(((DAY($dm:)-1)/7)*7)
anmac1789
Posts: 680
Joined: Mon Aug 24, 2020 1:16 pm

Re: DST times not showing dm: times with 2 AM

Post by anmac1789 »

Thank you for clarifying. How do I combine this into a date range such as from Jan 1, 2018 to the 1st Sunday of March 2018? From 1st Sunday of March 2018 to 2nd Sunday of November 2018 ?
void
Developer
Posts: 17152
Joined: Fri Oct 16, 2009 11:31 pm

Re: DST times not showing dm: times with 2 AM

Post by void »

There's no easy way to do this in Everything.

Lookup the 1st Sunday of March 2018 and be specific with your search range in Everything:

dm:2018-01-01..2018-03-04
anmac1789
Posts: 680
Joined: Mon Aug 24, 2020 1:16 pm

Re: DST times not showing dm: times with 2 AM

Post by anmac1789 »

alright thank you, will a feature such as this come in the next release of everything ?
void
Developer
Posts: 17152
Joined: Fri Oct 16, 2009 11:31 pm

Re: DST times not showing dm: times with 2 AM

Post by void »

dm:>=2018-01-01 $dm:<DATE(2018,3,1)+(8-(WEEKDAY(DATE(2018,3,1)-840000000000)+1))*840000000000

Replace 2018,3 with your year,month.

Excel: How to Find the First Sunday of Each Month
void
Developer
Posts: 17152
Joined: Fri Oct 16, 2009 11:31 pm

Re: DST times not showing dm: times with 2 AM

Post by void »

Everything 1.5.0.1384a changes WEEKDAY() to match the return values from Excel.

To find date modified on the first Sunday:
WEEKDAY($dm:)-1+(((DAY($dm:)-1)/7)*7)==0


To find date modified on the second Sunday:
WEEKDAY($dm:)-1+(((DAY($dm:)-1)/7)*7)==7




DATE() now returns an Excel date serial number.

To find date modified after 2018-01-01, or before the 1st Sunday of March 2018
dm:>=2018-01-01 DATEVALUE($dm:)<DATE(2018,3,1)-1+(8-WEEKDAY(DATE(2018,3,1)-1))
anmac1789
Posts: 680
Joined: Mon Aug 24, 2020 1:16 pm

Re: DST times not showing dm: times with 2 AM

Post by anmac1789 »

How can I extend this to include a range from Jan 1, 2018 until Mar 11, 2018 @ 1:59 AM AND Nov 4, 2018 @ 1:59 AM until end of Dec 2018 ? which is only EDT timezone. Similarly, how can I extend it limit results from 1st Sunday of March @ 1:59 AM until 2nd Sunday of November 2018 @ 1:59 AM ? since 2 AM doesnt exist and becomes 3 AM and henchforth becomes EST time?
void
Developer
Posts: 17152
Joined: Fri Oct 16, 2009 11:31 pm

Re: DST times not showing dm: times with 2 AM

Post by void »

date only:
dm:2018 DATEVALUE($dm:)<=DATE(2018,3,1)-1+(8-WEEKDAY(DATE(2018,3,1)-1)) | DATEVALUE($dm:)>=DATE(2018,11,1)-1+7+(8-WEEKDAY(DATE(2018,11,1)-1))


date/time:
dm:2018 DATEVALUE($dm:)+TIMEVALUE($dm:)<=DATE(2018,3,1)+TIME(2,0,0)-1+(8-WEEKDAY(DATE(2018,3,1)-1)) | DATEVALUE($dm:)+TIMEVALUE($dm:)>=DATE(2018,11,1)+TIME(2,0,0)-1+7+(8-WEEKDAY(DATE(2018,11,1)-1))
anmac1789
Posts: 680
Joined: Mon Aug 24, 2020 1:16 pm

Re: DST times not showing dm: times with 2 AM

Post by anmac1789 »

is there a way to calculate the 1st Sunday in November of any year? or the 2nd Sunday in March of any year ?
void
Developer
Posts: 17152
Joined: Fri Oct 16, 2009 11:31 pm

Re: DST times not showing dm: times with 2 AM

Post by void »

DATEVALUE($dm:)+TIMEVALUE($dm:)<=DATE(YEAR($dm:),3,1)+TIME(2,0,0)-1+(8-WEEKDAY(DATE(YEAR($dm:),3,1)-1)) | DATEVALUE($dm:)+TIMEVALUE($dm:)>=DATE(YEAR($dm:),11,1)+TIME(2,0,0)-1+7+(8-WEEKDAY(DATE(YEAR($dm:),11,1)-1))
anmac1789
Posts: 680
Joined: Mon Aug 24, 2020 1:16 pm

Re: DST times not showing dm: times with 2 AM

Post by anmac1789 »

void wrote: Sat Dec 21, 2024 7:07 am
DATEVALUE($dm:)+TIMEVALUE($dm:)<=DATE(YEAR($dm:),3,1)+TIME(2,0,0)-1+(8-WEEKDAY(DATE(YEAR($dm:),3,1)-1)) | DATEVALUE($dm:)+TIMEVALUE($dm:)>=DATE(YEAR($dm:),11,1)+TIME(2,0,0)-1+7+(8-WEEKDAY(DATE(YEAR($dm:),11,1)-1))

none of these give the 2nd sunday of march or 1st sunday of november. Please see screenshot

image.png
image.png (375.59 KiB) Viewed 723 times
NotNull
Posts: 5517
Joined: Wed May 24, 2017 9:22 pm

Re: DST times not showing dm: times with 2 AM

Post by NotNull »

What have you tried yourself?

I have a hard time believing that after 676 posts on this board, you still need spoon-feeding.
I bet you can figure it out yourself. All knowledge you need should be in this exact thread.
And if not: in one of the other threads you started involving DST.

Good luck!
void
Developer
Posts: 17152
Joined: Fri Oct 16, 2009 11:31 pm

Re: DST times not showing dm: times with 2 AM

Post by void »

Similarly, how can I extend it limit results from 1st Sunday of March @ 1:59 AM until 2nd Sunday of November 2018 @ 1:59 AM ?
Do you mean the 2nd Sunday of March and the 1st Sunday of November?



DATEVALUE($dm:)+TIMEVALUE($dm:)<=DATE(YEAR($dm:),3,1)+TIME(2,0,0)-1+7+(8-WEEKDAY(DATE(YEAR($dm:),3,1)-1)) | DATEVALUE($dm:)+TIMEVALUE($dm:)>=DATE(YEAR($dm:),11,1)+TIME(2,0,0)-1+(8-WEEKDAY(DATE(YEAR($dm:),11,1)-1))
anmac1789
Posts: 680
Joined: Mon Aug 24, 2020 1:16 pm

Re: DST times not showing dm: times with 2 AM

Post by anmac1789 »

void wrote: Sat Dec 21, 2024 9:02 pm
Similarly, how can I extend it limit results from 1st Sunday of March @ 1:59 AM until 2nd Sunday of November 2018 @ 1:59 AM ?
Do you mean the 2nd Sunday of March and the 1st Sunday of November?



DATEVALUE($dm:)+TIMEVALUE($dm:)<=DATE(YEAR($dm:),3,1)+TIME(2,0,0)-1+7+(8-WEEKDAY(DATE(YEAR($dm:),3,1)-1)) | DATEVALUE($dm:)+TIMEVALUE($dm:)>=DATE(YEAR($dm:),11,1)+TIME(2,0,0)-1+(8-WEEKDAY(DATE(YEAR($dm:),11,1)-1))


yes that's correct it should be switched around, 2nd Sunday March, 1st Sunday November. Also, there is one file where the time doesn't change, its file 5003.JPG, date modified is 2024-11-03 01:16:01. Does this mean that this file's true time is after DST ends ?

image.png
image.png (487.89 KiB) Viewed 697 times

image.png
image.png (482.4 KiB) Viewed 697 times
void
Developer
Posts: 17152
Joined: Fri Oct 16, 2009 11:31 pm

Re: DST times not showing dm: times with 2 AM

Post by void »

What does Everything see for the date on these files?

pic: dm:202411 addcolumn:column-2;column-3 column2:=DATEVALUE($dm:)+TIMEVALUE($dm:) column3:=DATE(YEAR($dm:),11,1)+TIME(2,0,0)-1+(8-WEEKDAY(DATE(YEAR($dm:),11,1)-1))DATEVALUE($dm:)+TIMEVALUE($dm:)>=DATE(YEAR($dm:),11,1)+TIME(2,0,0)-1+(8-WEEKDAY(DATE(YEAR($dm:),11,1)-1))


What is shown in Column 2 and 3?


Please try:
DATEVALUE($dm:)+TIMEVALUE($dm:)<=DATE(YEAR($dm:),3,1)+TIME(2,0,0)-1+7+(8-WEEKDAY(DATE(YEAR($dm:),3,1)-1)) | DATEVALUE($dm:)+TIMEVALUE($dm:)>=DATE(YEAR($dm:),11,1)+TIME(3,0,0)-1+(8-WEEKDAY(DATE(YEAR($dm:),11,1)-1))


Normally, 2am-3am will map to 1am-2am as this hour doesn't exist.
anmac1789
Posts: 680
Joined: Mon Aug 24, 2020 1:16 pm

Re: DST times not showing dm: times with 2 AM

Post by anmac1789 »

void wrote: Sun Dec 22, 2024 1:38 am What does Everything see for the date on these files?

pic: dm:202411 addcolumn:column-2;column-3 column2:=DATEVALUE($dm:)+TIMEVALUE($dm:) column3:=DATE(YEAR($dm:),11,1)+TIME(2,0,0)-1+(8-WEEKDAY(DATE(YEAR($dm:),11,1)-1))DATEVALUE($dm:)+TIMEVALUE($dm:)>=DATE(YEAR($dm:),11,1)+TIME(2,0,0)-1+(8-WEEKDAY(DATE(YEAR($dm:),11,1)-1))


What is shown in Column 2 and 3?
image.png
image.png (394.39 KiB) Viewed 622 times
But, this is just for winter dates after Nov 3, 2024. There is only one file with date 2024-11-03 02:42:50, but this date doesn't fluctuate when I switch DST on/off
void
Developer
Posts: 17152
Joined: Fri Oct 16, 2009 11:31 pm

Re: DST times not showing dm: times with 2 AM

Post by void »

These results look fine, back to the previous results, with your red and yellow arrows.
What search did you use?
I see now that the results are inverted.
I am guessing the two results shown, modified on the 2024-11-03T1:40 and 2024-11-03T1:16 are within your search range.

The sort order is odd, but that's because 1:40 is converted to 0:40 at display time.
The internal filetime sort order is correct.

The 2024-11-03T1:16 time must be outside the DST range.
anmac1789
Posts: 680
Joined: Mon Aug 24, 2020 1:16 pm

Re: DST times not showing dm: times with 2 AM

Post by anmac1789 »

void wrote: Sun Dec 22, 2024 8:16 am These results look fine, back to the previous results, with your red and yellow arrows.
What search did you use?
I see now that the results are inverted.
I am guessing the two results shown, modified on the 2024-11-03T1:40 and 2024-11-03T1:16 are within your search range.

This is the command I used:
pic: dm:202411 column1:=DATEVALUE($dm:)+TIMEVALUE($dm:)>=DATE(YEAR($dm:),11,1)+TIME(2,0,0)-1+(8-WEEKDAY(DATE(YEAR($dm:),11,1)-1)) DATEVALUE($dm:)+TIMEVALUE($dm:)<=DATE(YEAR($dm:),11,1)+TIME(2,0,0)-1+(8-WEEKDAY(DATE(YEAR($dm:),11,1)-1))


void wrote: Sun Dec 22, 2024 8:16 am The sort order is odd, but that's because 1:40 is converted to 0:40 at display time.
The internal filetime sort order is correct.

The sort order is odd because I am sorting by ascending date modified


void wrote: Sun Dec 22, 2024 8:16 am The 2024-11-03T1:16 time must be outside the DST range.

For the last file with modified time 2024-11-03 01:16:01 (DST off) and 2024-11-03 01:16:01 (DST on), why doesn't the time change ? on Nov 3, 2024 @ 2 AM is when the time goes from 2 AM to 3 AM, so essentially wouldn't the time change from 1:16:01 to 2:16:01 which will jump to 3:16:01 ?
void
Developer
Posts: 17152
Joined: Fri Oct 16, 2009 11:31 pm

Re: DST times not showing dm: times with 2 AM

Post by void »

It stays the same because 2:16:01 goes backwards to 1:16:01

2am to 3am doesn't exists.
Windows always shifts non-existing times backwards.
anmac1789
Posts: 680
Joined: Mon Aug 24, 2020 1:16 pm

Re: DST times not showing dm: times with 2 AM

Post by anmac1789 »

void wrote: Sun Dec 22, 2024 9:31 am It stays the same because 2:16:01 goes backwards to 1:16:01

2am to 3am doesn't exists.
Windows always shifts non-existing times backwards.
So if the 2 AM-3 AM hour doesn't exist (2:00 AM-2:59 AM) then any picture taken at or before 1:59 AM on Nov 3, 2024, will not have their hour change when DST turns on/off ? or have I misunderstood something ?
void
Developer
Posts: 17152
Joined: Fri Oct 16, 2009 11:31 pm

Re: DST times not showing dm: times with 2 AM

Post by void »

Other way around, the clock goes back one hour on Nov 3 2024.
There's overlapping times for 1am and 2am. (before DST ends and after DST ends)
You can have some files between 1am and 2am that are in DST and some files between 1am and 2am that are not in DST.


image.png
image.png (91.51 KiB) Viewed 444 times
Selected items are in DST.

Check Column A, the date modified is shown in UTC.

Include the following in your search to see date modified in UTC
add-column:a a:=$dm: aformat:filetimeutc


Everything uses FILETIMEs internally.
FILETIMEs are in UTC and are the number of 100 nanoseconds since the year 1601.

To work with UTC instead of local time, replace
$dm:
with
LOCALFILETIMETOFILETIME($dm:)
Post Reply