Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/O Code)
 date substractaction
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

zinpin
Junior Member

Australia
202 Posts

Posted - 07 January 2003 :  22:49:23  Show Profile
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  Show Profile  Visit masterao's Homepage
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
Go to Top of Page

zinpin
Junior Member

Australia
202 Posts

Posted - 07 January 2003 :  23:06:23  Show Profile
Outside the forum.
Go to Top of Page

masterao
Senior Member

Sweden
1678 Posts

Posted - 07 January 2003 :  23:29:59  Show Profile  Visit masterao's Homepage
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
Go to Top of Page

zinpin
Junior Member

Australia
202 Posts

Posted - 08 January 2003 :  06:09:42  Show Profile
thanks masterao that exactly what i needed!
Go to Top of Page

masterao
Senior Member

Sweden
1678 Posts

Posted - 08 January 2003 :  09:09:53  Show Profile  Visit masterao's Homepage
Your welcome.

Jan
===========
FR Portal Forums | Active Users 4.0.20 Mod
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 08 January 2003 :  09:13:43  Show Profile  Send ruirib a Yahoo! Message
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
Go to Top of Page

homeacademy
Junior Member

USA
163 Posts

Posted - 08 January 2003 :  09:16:20  Show Profile
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!
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.29 seconds. Powered By: Snitz Forums 2000 Version 3.4.07