system
May 22, 2008, 11:15am
1
Hi,.
I have two Datetime Fields.,
Like Createdatetime, Updated Datetime
I want to calculate Time (HH:MM) difference between those two datetime fields…Is it possible
For Example
12/Jan/2008 10:55:00 ,13/Jan/2008 11:45:00
The Result Should be :23:53
How can i do this…?
Thanks in advance
Sasa (BOB member since 2006-04-05)
system
May 22, 2008, 12:00pm
2
The difference is actually 24:50:00 (there is a complete day between the two datetime’s unless I’m missing something)
I started with a datediff formula -
Then used a time conversion formula
local numbervar RemainingMinutes;
local numbervar Hours ;
local numbervar Minutes;
//divide the @DateDiff by 3600 to calculate
// hours. Use truncate to remove the decimal portion.
Hours := truncate({@DATEDIFF } / 60);
// Subtract the hours portion to get RemainingSeconds
RemainingMinutes := {@DATEDIFF } - (Hours * 60);
// Use truncate to remove the decimal portion.
Minutes := truncate(RemainingMinutes);
// Format the hours, minutes, and seconds to hh:mm:ss
totext(Hours,“00”) + “:” + totext(Minutes,“00”)
Neinta (BOB member since 2008-05-22)