Ok, besides the fact that nobody has enough of it, I have another time problem with the repository. I can’t get the dates to come out right, and I need some help telling me exactly what to do to correct my math - or telling me that yes, in fact, the times are wrong. I’ve posted before with little result concerning the date, and I still can’t get our repository to come out correctly. But I also can’t get their examples to work. Take this, for instance, straight from the documentation:
If 820897350 is stored in the repository, it corresponds to (in UTC format, do not forget): 12/19/96 at 04:02:30 PM.
If I break this down, I can go at it like this:
From December 15, 1970, there have been 820897350 seconds until the above date. That means there have been:
820897350 / (60 seconds) minutes, or
820897350 / (60 seconds * 60 minutes ) hours, or
820897350 / (60 seconds * 60 minutes * 24 hours) days, which gives us
9501.127 days (rounded).
Suppose we assume 365 days a year - so we need (26 years * 365 days) days, or 9490 days. Now we can add on the extra four days from the 15th of a month to the 19, giving us 9494, != 9501.
Next, lets assume thirty days in a month, meaning between December 15, 1970 and December 19, 1996, there has been (12 months * 26 years) months, or 312 months, plus four days and some change. That’s (312 * 30) + 4… days, or 9364 days. Not correct.
Lets find out exactly how many days are between these two - There’s 9501 days, but 16 hours and some change - about 820944150 seconds.
When I use db2’s timestampdiff forumula, I come up incorrectly, too:
values timestampdiff( 2, char( timestamp( ‘1996-12-19-16.02.30’ ) - timestamp( ‘1970-12-15-00.00.00’) ) )
gives me 820339350. How can I get the actual correct date out? I’m getting similar incorrect numbers inside my repository, too. Any help on how you get the correct time, or even if you get the correct time or the wrong time, would be appreciated.
smokybfgs (BOB member since 2004-06-18)