Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I have got a column named 'Last_Modified' which displays the data in 'MM/DD/YYYY HH:MM:SS' format.
Now all I want is to calculate the difference between the 'last modified' data to current local time and to display the output in HH:MM:SS format in a straight table.
Example data
Last_Modified
3/9/2013 2:00:01 AM
2/21/2013 10:54:32 PM
.
.
.
.
2/12/2012 11:34:22AM
Any help would be appreciated.
Regards,
Priya
Priya,
That would be an expression in your table:
interval(now() - Last_Modified, 'hh:mm:ss')
But using function now() on the front end is problematic because it will be evaluation current time every moment. Use now(2) to get the time of document openeng or now(0) for the last reload time.
Regards,
Michael
Hi ,
Try the below code
=Interval( Timestamp( Today(), 'DD/MM/YYYY hh:mm:ss' )-Timestamp#(MyFieldName, 'DD/MM/YYYY hh:mm:ss'))
//yusuf
Priya, I recommend the now() function. So dimension = Last_modified, Expression would be something like time(now(0,1,or 2)-Last_modified).
try: interval(now() - timestamp#(Last_Modified,'MM/DD/YYYY hh:mm:ss') ,'hh:mm:ss')
Or in the script:
Let vNow = now();
Table1:
load
Last_Modified,
interval( $(vNow) - timestamp#(Last_Modified,'MM/DD/YYYY hh:mm:ss') ,'hh:mm:ss') as TimeDiff
from ...somewhere...;
Priya,
That would be an expression in your table:
interval(now() - Last_Modified, 'hh:mm:ss')
But using function now() on the front end is problematic because it will be evaluation current time every moment. Use now(2) to get the time of document openeng or now(0) for the last reload time.
Regards,
Michael
Thanks Michael.
Its really helpful ..It works