Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi!
How do I get the timestamp difference in days and time?
When i do below expression, it's giving me a result in decimal (eg. 4.041).
Timestamp#(Timestamp#(LastMod)-Timestamp#(Change)).
I want this the result as follows:
Change LastMod Result should be
6/1/2016 12:24:00 AM 6/5/2016 1:24:00 PM "4 days" and however many hh:mm:ss left
Thanks in advance for your help!
May be this
Floor(LastMod) - Floor(Change)
perhaps
=floor(LastMod-Change)&' days and however many '& timestamp(mod(LastMod-Change,1),'hh:mm:ss')&' left'
I modified it a little bit as below:
=floor(LastMod-Change)&' days & '& =time(frac(Change) - frac(LastMod), 'hh:mm:ss')&' hh:mm:ss left'
Thank you Sunny And Robin!
You can try something like this in the script:
T1:
LOAD * INLINE [
Change, LastMod
6/1/2016 12:24:00 AM, 6/5/2016 1:24:00 PM
];
T2:
LOAD
Timestamp#(Change, 'M/D/YYYY hh:mm:ss TT') as ChangeTimeStamp,
Timestamp#(LastMod, 'M/D/YYYY hh:mm:ss TT') as LastModTimeStamp,
Interval( Timestamp#(LastMod, 'M/D/YYYY hh:mm:ss TT') - Timestamp#(Change, 'M/D/YYYY hh:mm:ss TT'), 'dd-hh:mm' ) as Result
Resident
T1
;
Good Luck
Oscar