How to extract timestamp into custom columns ?
How to extract timestamp into custom columns ?
hello everyone, how do I extract certain time format from a timestamp property and display it in a custom column ? For example, I want to put the hour from date taken in custom column1 and the hour from date modified into custom column2 and format the custom column as hh:mm or hh:mm:ss ?
Re: How to extract timestamp into custom columns ?
addcolumn:a;b a:=formatfiletime($date-taken:,"HH:mm:ss") b:=formatfiletime($date-modified:,"HH:mm:ss")
formatfiletime()
Time Format
formatfiletime()
Time Format
Re: How to extract timestamp into custom columns ?
what about calculating the difference between the date taken and date modified in a custom column formatted as "hh:mm:ss" ??void wrote: ↑Fri Nov 03, 2023 3:16 am addcolumn:a;b a:=formatfiletime($date-taken:,"HH:mm:ss") b:=formatfiletime($date-modified:,"HH:mm:ss")
formatfiletime()
Time Format
Re: How to extract timestamp into custom columns ?
addcolumn:a a:=formatduration($date-modified:-$date-taken:,"[hh]:mm:ss")
formatduration()
Duration Syntax
formatduration()
Duration Syntax
Re: How to extract timestamp into custom columns ?
There seems to be a mistake in calculating the duration. Please see the screenshot:void wrote: ↑Fri Nov 03, 2023 3:23 am addcolumn:a a:=formatduration($date-modified:-$date-taken:,"[hh]:mm:ss")
formatduration()
Duration Syntax
Re: How to extract timestamp into custom columns ?
The result is truncated.
00:00:02 is correct.
00:00:02.1700000 is the true value.
What value are you expecting?
The folder doesn't have a date taken value.
To show the ceiling value, please try the following search:
addcolumn:a a:=formatduration($date-modified:-$date-taken:+9999999,"[hh]:mm:ss")
To show the full time difference in 100-nano-seconds:
addcolumn:a a:=formatduration($date-modified:-$date-taken:,"[hh]:mm:ss.SSSSSSS")
00:00:02 is correct.
00:00:02.1700000 is the true value.
What value are you expecting?
The folder doesn't have a date taken value.
To show the ceiling value, please try the following search:
addcolumn:a a:=formatduration($date-modified:-$date-taken:+9999999,"[hh]:mm:ss")
To show the full time difference in 100-nano-seconds:
addcolumn:a a:=formatduration($date-modified:-$date-taken:,"[hh]:mm:ss.SSSSSSS")
Re: How to extract timestamp into custom columns ?
I'm expecting the exact time difference between the seconds or milliseconds...u know like doing actual math lol (without rounding or truncation). Where did you get 00:00:02.1700000 ???void wrote: ↑Fri Nov 03, 2023 3:37 am The result is truncated.
00:00:02 is correct.
00:00:02.1700000 is the true value.
What value are you expecting?
To show the ceiling value, please try the following search:
addcolumn:a a:=formatduration($date-modified:-$date-taken:+9999999,"[hh]:mm:ss")
To show the full time difference in 100-nano-seconds:
addcolumn:a a:=formatduration($date-modified:-$date-taken:,"[hh]:mm:ss.SSSSSSS")
Re: How to extract timestamp into custom columns ?
From the focused file:
Code: Select all
date-modified: 06:03:31.0000000 -
date-taken: 06:03:28.8300000 =
difference: 00:00:02.1700000
Re: How to extract timestamp into custom columns ?
to show it in minutes and seconds..it would be [mm]:ss.SSSSSSSSSS or [mm]:[ss.SSSSSSSSSS] ?void wrote: ↑Fri Nov 03, 2023 3:44 am From the focused file:
Code: Select all
date-modified: 06:03:31.0000000 - date-taken: 06:03:28.8300000 = difference: 00:00:02.1700000
Why does it do something like this ? lol
Re: How to extract timestamp into custom columns ?
[mm]:ss.SSSSSSS
Re: How to extract timestamp into custom columns ?
The maximum number of SSS's is 7
I'll make this a hard cap in the next alpha update..
I'll make this a hard cap in the next alpha update..
Re: How to extract timestamp into custom columns ?
It's just repeating the same 7 digits over and over.
There's a maximum of 7 decimal places for 100-nano-second FILETIMEs when shown as seconds.
There's a maximum of 7 decimal places for 100-nano-second FILETIMEs when shown as seconds.
Re: How to extract timestamp into custom columns ?
I see...can you also add AM/PM because when a date says 02:20:31.0000000 I dont know if it's 2 AM or 2 PM. Also, there is one file for which the time difference doesn't make sense to me. Please see the the screenshot highlighting the particular file of interest.
140 days, 4 hours, 43 minutes, 54 seconds, 0.2002273 ms (shown as 100 ns seconds)
If you add 140 days to Aug 18, 2022 it is Jan 5, 2023. If you add 4 hours to 02:20:31.0000000 then it will be 06:20:31.0000000 PM. If you add 43 minutes then it will be 06:(20+43=63 min --> 63 min - 60 min = 1 hour, 3 min):31.0000000 PM --> 07:03:31.0000000 PM. If you add 54.2002273 seconds to 07:03:31.0000000 PM then it will be 07:03:(31.0000000 s + 54.2002273 s = 85.2002273 s - 60 s = 1 min, 25.2002273 s) PM --> 07:04:32.25.2002273 PM. Why is this showing the wrong time ? or did I make a mistake in my calculations ?
Last edited by anmac1789 on Fri Nov 03, 2023 5:15 am, edited 1 time in total.
Re: How to extract timestamp into custom columns ?
It doesn't make any sense to show AM/PM on time differences.I see...can you also add AM/PM because when a date says 02:20:31.0000000 I dont know if it's 2 AM or 2 PM
Day light savings occurred during this period.if you compare the difference between the date taken and date modified of the highlighted file, the hour is off by 1
Everything uses FILETIMEs internally for date modified and date taken.
FILETIMEs are 100-nanosecond intervals since January 1, 1601 (UTC).
To view the FILETIMEs, include the following in your search:
addcolumn:a;b;c a:=$date-modified: b:=$date-taken: c:=$date-modified:-$date-taken: a-label:="Date Modified FILETIME" b-label:="Date Taken FILETIME" c-label:="Time difference in 100-nano-seconds"
Re: How to extract timestamp into custom columns ?
To view the data/times as UTC:
addcolumn:a;b;c a:=FORMATFILETIMEUTC($date-modified:) b:=FORMATFILETIMEUTC($date-taken:) c:=formatduration($date-modified:-$date-taken:,"[d]:hh:mm:ss.SSSSSSS") a-label:="Date Modified UTC" b-label:="Date Taken UTC" c-label:="Time difference in 100-nano-seconds"
You will see the correct time difference here.
FORMATFILETIMEUTC()
addcolumn:a;b;c a:=FORMATFILETIMEUTC($date-modified:) b:=FORMATFILETIMEUTC($date-taken:) c:=formatduration($date-modified:-$date-taken:,"[d]:hh:mm:ss.SSSSSSS") a-label:="Date Modified UTC" b-label:="Date Taken UTC" c-label:="Time difference in 100-nano-seconds"
You will see the correct time difference here.
FORMATFILETIMEUTC()
Re: How to extract timestamp into custom columns ?
Oh, I only mean to show AM/PM for the expanded time format hh:mm:ss.SSSSSSS not the time difference
Re: How to extract timestamp into custom columns ?
I see the correct time difference only when the date taken and date modified are both observing DST or both not observing DST, if the date taken is observing DST and date modified is not, the time will be off by 1 hour and vice versavoid wrote: ↑Fri Nov 03, 2023 5:17 am To view the data/times as UTC:
addcolumn:a;b;c a:=FORMATFILETIMEUTC($date-modified:) b:=FORMATFILETIMEUTC($date-taken:) c:=formatduration($date-modified:-$date-taken:+9999999,"[d]:hh:mm:ss.SSSSSSS") a-label:="Date Modified UTC" b-label:="Date Taken UTC" c-label:="Time difference in 100-nano-seconds"
You will see the correct time difference here.
format_duration not showing exact difference
For the highlighted file time difference between date taken and date modified, why is it -0 ? it should be 2 seconds. Please see screenshot
Re: How to extract timestamp into custom columns ?
Formatting with s.SSSSSSSSSSSSSSSSSSSS will be fixed in the next alpha update.
For now, please try formatting with:
s.SSSSSSS
-or-
avoid the formatting:
column1:=$date-modified:-$date-taken:
For now, please try formatting with:
s.SSSSSSS
-or-
avoid the formatting:
column1:=$date-modified:-$date-taken:
Re: How to extract timestamp into custom columns ?
Why doesn't ss:SSSSSSS work ? isnt the 7 long S's suppose to represent 100 nanoseconds ?
Re: How to extract timestamp into custom columns ?
SSSSSSS is a quirk.
It shows the fraction of seconds. (upto 100 nanosecond resolution)
It should only ever be used after s or ss
The following should work as expected:
ss:SSSSSSS
shows seconds with a leading zero
shows fraction of seconds after ':'
What is shown for you?
It shows the fraction of seconds. (upto 100 nanosecond resolution)
It should only ever be used after s or ss
The following should work as expected:
ss:SSSSSSS
shows seconds with a leading zero
shows fraction of seconds after ':'
What is shown for you?
Re: How to extract timestamp into custom columns ?
ss:SSSSSSS shows somwthing like 01:0000000 but ss.SSSSSSS shows the exact 100 nanosecond resolution
Re: How to extract timestamp into custom columns ?
Also, is it possible to define a less than and greater than < > range for the format duration custom column ?
I think it would be very useful if math inequalities could be used with search properties. For example
search all files which have difference between date taken and date modified is greater than 1 second...(or 2 seconds, 1 hour, 12 hrs..etc)
(date-taken:<date-modified:)>00:00:01 -- greater than 1 sec
(date-taken:<date-modified:)<=01:00:00 --less than or equal to 1 hour difference
Re: How to extract timestamp into custom columns ?
Greater than 1 second:
$date-modified:-$date-taken:>10000000
Less than or equal to 1 hour:
$date-modified:-$date-taken:<=10000000*60*60
$date-modified:-$date-taken:>10000000
Less than or equal to 1 hour:
$date-modified:-$date-taken:<=10000000*60*60
Re: How to extract timestamp into custom columns ?
thanks void and does the subtraction need to be in brackets ?
Re: How to extract timestamp into custom columns ?
Everything 1.5.0.1360a will now correctly format filetimes when using 3 S or more.
For example:
ss.SSSSSSSSSS
Zeros are always shown after the 7th decimal place.
Added a FILETIMETOLOCALFILETIME() formula function.
This might be useful to perform arthritic on filetimes in local time.
For example:
addcolumn:a a:=FORMATDURATION(FILETIMETOLOCALFILETIME($date-modified:)-FILETIMETOLOCALFILETIME($date-taken:),"[d]:hh:mm:ss.SSSSSSS")
For example:
ss.SSSSSSSSSS
Zeros are always shown after the 7th decimal place.
Added a FILETIMETOLOCALFILETIME() formula function.
This might be useful to perform arthritic on filetimes in local time.
For example:
addcolumn:a a:=FORMATDURATION(FILETIMETOLOCALFILETIME($date-modified:)-FILETIMETOLOCALFILETIME($date-taken:),"[d]:hh:mm:ss.SSSSSSS")
Re: How to extract timestamp into custom columns ?
Thank you for this void it's very helpfulvoid wrote: ↑Thu Nov 16, 2023 7:40 am Everything 1.5.0.1360a will now correctly format filetimes when using 3 S or more.
For example:
ss.SSSSSSSSSS
Zeros are always shown after the 7th decimal place.
Added a FILETIMETOLOCALFILETIME() formula function.
This might be useful to perform arthritic on filetimes in local time.
For example:
addcolumn:a a:=FORMATDURATION(FILETIMETOLOCALFILETIME($date-modified:)-FILETIMETOLOCALFILETIME($date-taken:),"[d]:hh:mm:ss.SSSSSSS")
Re: How to extract timestamp into custom columns ?
I just want to come back to this topic but using the following format duration still displays the long millisecond resolution repeatedly:
column2:=formatduration($date-modified:-$date-taken:,"[d]:hh:mm:ss.SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS")
Re: How to extract timestamp into custom columns ?
This is expected output.
What values are you expecting?
Timestamps only have a resolution of 100-nanoseconds ( [d]:hh:mm:ss.SSSSSSS )
Any extra SSS's will always be zero.
What values are you expecting?
Timestamps only have a resolution of 100-nanoseconds ( [d]:hh:mm:ss.SSSSSSS )
Any extra SSS's will always be zero.