calculate the time in seconds between two dates

I have 3 fields in a table
RegistrationDate RegistrationTime Duration
12/10/2013 3:24 0
12/11/2013 12:00 X?

I want the result in seconds for X? knowing that this time is equal to the difference between
(12/11/2013 - 12/10/2013) + (12:00 - 3:24 )

Hi,

We had a number of discussions on this subject here. A search should give you the solution.

I did a quick search and found this - http://dynamicsuser.net/forums/p/59937/321992.aspx#321992

Thank you a lot Harish Mohanbabu,
just a short question if I want to assign the result time2StrHMS(int642int(DateTimeUtil::getDifference(todt, fromdt))) to my field,
my field must be of what type?

time2StrHMS(), as its name suggests, converts time to string in hh:mm:ss format, therefore the type is string. Normally the length needed is 8, because the number of hours should be between 0 and 23. But your code (at least the part you showed) doesn’t guarantee that - if the difference was 1000 hours, the result would be 1000:00:00 (string length 10).

Thank you Martin it’s Ok