Author |
Topic |
|
laser
Advanced Member
Australia
3859 Posts |
Posted - 29 December 2005 : 05:55:48
|
I've developed my own add-on code (as usual), but using the Snitz functionality as much as possible. I'm using DateDiff to show the number of days between 2 dates, obviously, but it's slightly wrong.
e.g.
Comparing 1 Dec 2005, 23:00:00 with 15 Dec 2005, 01:00:00 results in a DateDiff of 14, but it's not quite 14 yet, it's more like 13.91
I'm looking at the code now, but is there any way to get a more precise DateDiff .... with decimal points would be great, or even just an "intpart" of the result. |
|
laser
Advanced Member
Australia
3859 Posts |
Posted - 29 December 2005 : 06:02:05
|
LOL @ me !!!!
It's an ASP function, not a Snitz function at all
Fixed : I dropped back to using hours, then divided by 24.
|
Edited by - laser on 29 December 2005 06:11:02 |
|
|
laser
Advanced Member
Australia
3859 Posts |
Posted - 29 December 2005 : 15:08:29
|
I've still got something wrong :
As at 30 Dec 2005 07:11 -> 16 Dec 2005 23:13:01 = 14.29 days
but that's not the right answer |
|
|
laser
Advanced Member
Australia
3859 Posts |
Posted - 30 December 2005 : 05:13:11
|
Anyone ? |
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 30 December 2005 : 06:41:17
|
quote: Originally posted by laser
I've still got something wrong :
As at 30 Dec 2005 07:11 -> 16 Dec 2005 23:13:01 = 14.29 days
but that's not the right answer
where did you get that answer ? according to my IIS I get the difference to be 19198 mins or 319.966666666667 hrs or 13.3319444444444 days
where did you get 14.29 ?
|
|
|
laser
Advanced Member
Australia
3859 Posts |
Posted - 30 December 2005 : 10:21:15
|
Yeah, I thought it would be that as well, it has to be less than 14
I'm using the code here :
http://www.v8central.com/snitz3403/penalty_reduce.asp
The "Days since last activity" is the one that is wrong, it's being calculated by (currently) :
daysMember = DateDiff("h", ChkDate(Members_ReviewDate,"",false), strForumTimeAdjust)
Then displayed as : Round(daysMember/24,2)
Remember we're talking Sydney times here, so I've added the time onto the page so you can see (bottom left corner, just above the footer).
|
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 30 December 2005 : 14:07:43
|
Ok, from what I can work out you are probably not passing the correct times to your function, can you get it to print out the two times.
if I run these times in my function I get 11.54 days not 12.25 like you do DateDiff("h","19 Dec 2005 17:26:54","31 Dec 2005 6:06:31") (times from your site) |
|
|
laser
Advanced Member
Australia
3859 Posts |
Posted - 30 December 2005 : 16:47:39
|
Yeah, I know the result I should be getting, but I think this is the problem, I've changed this :
DateDiff("h", ChkDate(Members_ReviewDate,"",false)
to this :
DateDiff("h", ChkDate(Members_ReviewDate,"",true)
Using false, it calculates from midnight |
|
|
ruirib
Snitz Forums Admin
Portugal
26364 Posts |
|
laser
Advanced Member
Australia
3859 Posts |
Posted - 31 December 2005 : 01:15:06
|
You must have misread my last post |
|
|
|
Topic |
|