Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
i need to calculate the difference between two dates in Seconds. start date: 6/8/2015 23:32:35 and End Date 6/8/2015 23:32:50.
Please suggest me the formula.
In the script, your timestamp format should be set accordingly:
SET TimestampFormat = 'M/D/YYYY hh:mm:ss';
Then you can load your values just use interval():
=interval( [End Date]-[Start Date],'ss')
or if you want to do further calculcation in units seconds:
=num#(interval( [End Date]-[Start Date],'ss'))
In the script, your timestamp format should be set accordingly:
SET TimestampFormat = 'M/D/YYYY hh:mm:ss';
Then you can load your values just use interval():
=interval( [End Date]-[Start Date],'ss')
or if you want to do further calculcation in units seconds:
=num#(interval( [End Date]-[Start Date],'ss'))
Hi Swuehl,
In my document the time format is set like this TimestampFormat='M/D/YYYY hh:mm:ss[.fff] TT'; and in the script i have given Interval(END_DATE-START_DATE,'ss'). But I am getting the result as 00 only.
try tis way,
=Interval(Interval(Sum(ProProductiveTime),'hh:mm:ss') - Interval(Sum(ProNonProductiveTime),'hh:mm:ss'),'hh:mm:ss')
You need to interpret the field values correctly before you can perform numeric calculations. If you don't want to change your global script settings, try
interval( timestamp#([End Date],'M/D/YYYY hh:mm:ss')-timestamp#([Start Date],'M/D/YYYY hh:mm:ss'),'ss')
Try this in script.
LOAD *,
Interval(timestamp#(End_Date, 'mm/dd/yyyy hh:mm:ss') - timestamp#(start_date, 'mm/dd/yyyy hh:mm:ss'), 'ss') as IntervalT
Inline [
start_date , End_Date
6/8/2015 23:32:35, 6/8/2015 23:32:50
];
Hi All,
I couldnt solve the issue using any of the above Suggestions. I am getting '_' as a result of this. Please help me to solve this
can u share ur app and expected output?
Hi All,
the Issue is fixed now. Due to some reasons the time format was wrong and that was causing the issue. And now i am able to find the difference using the Interval function alone. Thank you all for the valuable time.
load StartDate,EndDate,
Interval(Timestamp#(EndDate,'D/M/YYYY hh:mm:ss')-Timestamp#(StartDate,'D/M/YYYY hh:mm:ss'),'ss')
Inline
[
StartDate,EndDate
6/8/2015 23:32:35,6/8/2015 23:32:50
];