Gossamer Forum
Home : Products : DBMan : Customization :

comparing dates to get a number

Quote Reply
comparing dates to get a number
hi
I am struggling with this one.
I have a database which includes 3 fields "current date" "date last visited"
"reward points"
I would like the visitor to be rewarded points based on the difference between the two dates. This is what I have so far to get the difference in dates. This is just a mixture of ideas I found in the forum so I have no idea if it is correct.
Code:
$compare1 = &date_to_unix($rec{'datelastvisited'});
$compare2 = &date_to_unix($get_date);
$total = $compare2-$compare1;
$rec{rewardpoints} = $total

Now assuming this is the code(a big assumption), where would I put it if I wanted this information to be updated as soon as the visitor logged in.
I am a complete perl novice so help is appreciated.

I would like to have
Subject Author Views Date
Thread comparing dates to get a number carlstevenson 3213 Nov 2, 2002, 1:12 PM
Thread Re: [carlstevenson] comparing dates to get a number
LoisC 3144 Nov 4, 2002, 9:17 AM
Thread Re: [LoisC] comparing dates to get a number
carlstevenson 3135 Nov 4, 2002, 1:17 PM
Thread Re: [carlstevenson] comparing dates to get a number
carlstevenson 3127 Nov 4, 2002, 3:01 PM
Post Re: [carlstevenson] comparing dates to get a number
LoisC 3136 Nov 5, 2002, 9:19 AM