forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Days between dates?

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
jwfv
Valued Contributor
Valued Contributor


Joined: 19 Mar 2002
Posts: 422
Location: Beaufort, SC

PostPosted: Fri Jan 31, 2003 2:46 pm    Post subject: Days between dates? Reply with quote

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
View user's profile Send private message
jwfv
Valued Contributor
Valued Contributor


Joined: 19 Mar 2002
Posts: 422
Location: Beaufort, SC

PostPosted: Fri Jan 31, 2003 3:03 pm    Post subject: Got it - never mind Reply with quote

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
View user's profile Send private message
mbell
Newbie


Joined: 19 Jun 2002
Posts: 11

PostPosted: Tue Feb 04, 2003 8:47 pm    Post subject: DATETIME Solution To Problem Reply with quote

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 Very Happy see how it's done.

Thanks,



Milton Bell
San Antonio, TX
Back to top
View user's profile Send private message Send e-mail
jwfv
Valued Contributor
Valued Contributor


Joined: 19 Mar 2002
Posts: 422
Location: Beaufort, SC

PostPosted: Tue Feb 04, 2003 8:51 pm    Post subject: Days between Reply with quote

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
View user's profile Send private message
mbell
Newbie


Joined: 19 Jun 2002
Posts: 11

PostPosted: Tue Feb 04, 2003 9:02 pm    Post subject: Reply with quote

OK, thanks for the quick reply. But what format are the %%date1 and %%date2 in (said the novice VDS users)? Wink

Thanks,



Milton
Back to top
View user's profile Send private message Send e-mail
jwfv
Valued Contributor
Valued Contributor


Joined: 19 Mar 2002
Posts: 422
Location: Beaufort, SC

PostPosted: Tue Feb 04, 2003 9:10 pm    Post subject: Reply with quote

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
View user's profile Send private message
mbell
Newbie


Joined: 19 Jun 2002
Posts: 11

PostPosted: Tue Feb 04, 2003 9:19 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Tue Feb 04, 2003 11:46 pm    Post subject: Reply with quote

Ya can check this post for more @datetime() info:

http://www.vdsworld.com/forum/viewtopic.php?t=919

Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group