Hi All,
I am working on an application, which uses a timer consisting of the year, month, day, hour, minute and second fields. I need to be able to find the exact difference between the two dates (one of the dates is based on the current system date and the other is inputted by the user, but will always be in the past).
I have tried using the DateDiff function, but when it comes to the seconds it displays the total number of seconds, i.e. once it gets past 60 it just continues. I have also tried simply subtracting the dates, i.e.
This works fine for the hours, minutes and seconds, but the year comes up as 1899 and the month and day as various other random values.
Does anyone have any idea how I can do this without converting all of the values manually. I would expect to get something like the following:
Date1 = 20/08/2006 13:00:00
Date2 = 21/08/2006 14:05:45
Difference (Date2-Date1) = 0y 0m 1d 1h 5m 45s
Any help would be appreciated.
Andrew
I am working on an application, which uses a timer consisting of the year, month, day, hour, minute and second fields. I need to be able to find the exact difference between the two dates (one of the dates is based on the current system date and the other is inputted by the user, but will always be in the past).
I have tried using the DateDiff function, but when it comes to the seconds it displays the total number of seconds, i.e. once it gets past 60 it just continues. I have also tried simply subtracting the dates, i.e.
Code:
l_date_diff = format (l_current_date - l_end_date, "DD/MM/YYYY HH:MM:SS")
This works fine for the hours, minutes and seconds, but the year comes up as 1899 and the month and day as various other random values.
Does anyone have any idea how I can do this without converting all of the values manually. I would expect to get something like the following:
Date1 = 20/08/2006 13:00:00
Date2 = 21/08/2006 14:05:45
Difference (Date2-Date1) = 0y 0m 1d 1h 5m 45s
Any help would be appreciated.
Andrew