Custom Column for Calculating Difference Between Timestamps

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
python80
Posts: 16
Joined: 08 Jul 2022 05:49

Custom Column for Calculating Difference Between Timestamps

Post by python80 »

Hi!

First of all, I'm really sorry for bad English.

Is there a way to create a column like this:

Code: Select all

Modified              Created                Custom Column
03.03.2013 03:03:03   01.01.2011 01:01:01    02.02.0002 02:02:02
OR
Modified              Created                Custom Column
2013-03-03 03:03:03   2011-01-01 01:01:01    0002-02-02 02:02:02

"-": minus sign

Custom Column=Created Date - Modified Date (Created>Modified)
Custom Column=Modified Date - Created Date (Modified>Created)
Is it possible with scripting, etc.?

Thank you very much for reading.

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Custom Column for Calculating Difference Between Timestamps

Post by admin »

Interesting task. I added a new function to scripting that will return the filetime of a file. Now together with the datediff() function you can get e.g. the number of days between created and modified:

Code: Select all

return datediff(filetime(<cc_item>, "c"), filetime(<cc_item>, "m"), "d");
It will need more work to get exactly what you wanted. Have fun!

The new filetime() function will be part of the next beta version.

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Custom Column for Calculating Difference Between Timestamps

Post by admin »

Not impressed? :)

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: Custom Column for Calculating Difference Between Timestamps

Post by highend »

This was already possible via property (and #date.c / #date.m) before. Ofc it requires more effort for the format that he wants to use...
One of my scripts helped you out? Please donate via Paypal

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Custom Column for Calculating Difference Between Timestamps

Post by admin »

Yes, but the shell property does not return seconds. :)

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: Custom Column for Calculating Difference Between Timestamps

Post by highend »

What?

text "C: " . property("#date.c") . " | M: " . property("#date.m");

C: 19.07.2022 15:07:30 | M: 19.07.2022 15:07:32

Looks like seconds to me^^
One of my scripts helped you out? Please donate via Paypal

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Custom Column for Calculating Difference Between Timestamps

Post by admin »

To me too. :whistle:

I meant these:
text "C: " . property("#3") . " | M: " . property("#4");

python80
Posts: 16
Joined: 08 Jul 2022 05:49

Re: Custom Column for Calculating Difference Between Timestamps

Post by python80 »

admin wrote: 21 Jul 2022 09:52Not impressed? :)
I was really impressed. :)

That's enough for me. Thank you very much.

"return datediff(filetime(<cc_item>, "c"), filetime(<cc_item>, "m"), "d");"

"y": year
"m": month
"d": day
"h": hour
"s": second


What parameter is used for "minute"?

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: Custom Column for Calculating Difference Between Timestamps

Post by highend »

n^^
One of my scripts helped you out? Please donate via Paypal

python80
Posts: 16
Joined: 08 Jul 2022 05:49

Re: Custom Column for Calculating Difference Between Timestamps

Post by python80 »

highend wrote: 14 Aug 2022 20:11n^^
It works. Thank you very much.

Post Reply