Author |
Topic  |
|
zinpin
Junior Member
 
Australia
202 Posts |
Posted - 07 January 2003 : 22:49:23
|
Can someone help me with this. Iam trying to substract 2 dates (taken from the members table) one is the M_LastPostDate and the other M_lasthere.. what i want to end up is the number of days that results from the substraction. ie 5 or -2 or whatever...
|
Edited by - zinpin on 07 January 2003 23:23:47 |
|
masterao
Senior Member
   
Sweden
1678 Posts |
Posted - 07 January 2003 : 23:02:12
|
Are you using this on a forum page or on a page outside the forums? If you are using this on a forum page, try ChkDate(strYourDateVariable, "" ,false). |
Jan =========== FR Portal Forums | Active Users 4.0.20 Mod |
 |
|
zinpin
Junior Member
 
Australia
202 Posts |
Posted - 07 January 2003 : 23:06:23
|
Outside the forum.  |
 |
|
masterao
Senior Member
   
Sweden
1678 Posts |
Posted - 07 January 2003 : 23:29:59
|
Ok, then you need to open inc_func_common.asp, search for function chkDate(fDate,separator,fTime), and paste the function into the page that you want to display the date. You can then use the function as I suggested above.
If you do so, you also need to include the copyright notice in both the header of the page (<head></head>, which can be found in inc_header.asp) and the copyright code at the bottom of the page (found in inc_footer.asp). You would also need to include config.asp in that page.
An easier way is to do it like this. Im assuming that you already have a way of getting those dates and doing the subtraction of them.
To display only the date and not the time, you can do this:
Dim intMyDate
intMyDate = "20021121035559"
intMyDate = Left(intMyDate,8)
response.write intMyDate
The code in red should be the date you want to display. |
Jan =========== FR Portal Forums | Active Users 4.0.20 Mod |
 |
|
zinpin
Junior Member
 
Australia
202 Posts |
Posted - 08 January 2003 : 06:09:42
|
thanks masterao that exactly what i needed! |
 |
|
masterao
Senior Member
   
Sweden
1678 Posts |
|
ruirib
Snitz Forums Admin
    
Portugal
26364 Posts |
Posted - 08 January 2003 : 09:13:43
|
Zinpin, the function StrToDate will convert a Snitz "date" to a proper date value, which you can use then with datediff to calculate the value you want. StrToDate is available in inc_func_common.asp. |
Snitz 3.4 Readme | Like the support? Support Snitz too |
 |
|
homeacademy
Junior Member
 
USA
163 Posts |
Posted - 08 January 2003 : 09:16:20
|
quote: Originally posted by masterao
Are you using this on a forum page or on a page outside the forums? If you are using this on a forum page, try ChkDate(strYourDateVariable, "" ,false).
I have a bit of a different problem. Inside the forum, I have two date strings which I need to compare and determine the number of days between. They are in mmddyyyy form. One is derived from the member's profile, and one from the current date. The biggest date changes from member to member. I believe I need to use the DateDiff function, but am unsure exactly how to go about doing this. The ChkDate Snitz function you mention above, how does it work? Any ideas? Thanks in advance for any help! |
 |
|
|
Topic  |
|