| View previous topic :: View next topic |
| Author |
Message |
jwfv Valued Contributor

Joined: 19 Mar 2002 Posts: 422 Location: Beaufort, SC
|
Posted: Fri Jan 31, 2003 2:46 pm Post subject: Days between dates? |
|
|
I need to calculate the number of days between two dates that the user will enter.
I can't figure a way to do this. I have browsed through some .dlls, but none seems to have this function.
Any help is much appreciated. |
|
| Back to top |
|
 |
jwfv Valued Contributor

Joined: 19 Mar 2002 Posts: 422 Location: Beaufort, SC
|
Posted: Fri Jan 31, 2003 3:03 pm Post subject: Got it - never mind |
|
|
| Got it - did some reading of some old posts. Didn't realize you could subtract the @datetime() results and get the days returned! |
|
| Back to top |
|
 |
mbell Newbie
Joined: 19 Jun 2002 Posts: 11
|
Posted: Tue Feb 04, 2003 8:47 pm Post subject: DATETIME Solution To Problem |
|
|
I'm trying to create a program that will check the number of days that have expired since a file was posted on my FTP site and delete the file after 10 days.
I have created a clunky program that uses a Julian date text file, but if there's a way to do it using @DIFF and @DATETIME(), I'd be happy to see how it's done.
Thanks,
Milton Bell
San Antonio, TX |
|
| Back to top |
|
 |
jwfv Valued Contributor

Joined: 19 Mar 2002 Posts: 422 Location: Beaufort, SC
|
Posted: Tue Feb 04, 2003 8:51 pm Post subject: Days between |
|
|
Here's how I figured the days between %%date1 and %%date2:
%%daysinforce = @format(@fsub(@datetime(,%%date2),@datetime(,%%date1)),4.0)
It seems to work fine for me. |
|
| Back to top |
|
 |
mbell Newbie
Joined: 19 Jun 2002 Posts: 11
|
Posted: Tue Feb 04, 2003 9:02 pm Post subject: |
|
|
OK, thanks for the quick reply. But what format are the %%date1 and %%date2 in (said the novice VDS users)?
Thanks,
Milton |
|
| Back to top |
|
 |
jwfv Valued Contributor

Joined: 19 Mar 2002 Posts: 422 Location: Beaufort, SC
|
Posted: Tue Feb 04, 2003 9:10 pm Post subject: |
|
|
Ah yes.
In my script, it pulls the text from an edit box. Instead of %%date1, it is @dlgtext(date1). But THAT text is in the format:
2/4/03
So that format should work. I haven't tried others.
Hope it works - |
|
| Back to top |
|
 |
mbell Newbie
Joined: 19 Jun 2002 Posts: 11
|
Posted: Tue Feb 04, 2003 9:19 pm Post subject: |
|
|
PERFECT!!! That works! Now I can use your tip to remove a lot of lines from my source code, and it'll make the program a lot more reliable.
Many thanks for the help and timely replies.
Regards,
Milton |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
|
| Back to top |
|
 |
|