![]() |
|
|||||||
| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| Questions & Help Needed Post any question regarding Basic4ppc. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
Hi, Can someone help describe how I can calculate the number of days between two dates? Right now I can compare two dates but I don't know how to calculate the number of days between two dates. I'm trying to create a program that will remind me of birthdays and anniversaries 10 days before the event. Thanks for your help.: |
|
|||
|
I am attempting to use Erel example in my code. Previously , I was using DateDayofYear- which means that my program would only run on aper year basis. (Lol)
So now I have questions about using the Int((DATE-DATE)/cTicksPerDay) Case1- I understand if the date is the first date is x and the second is x then it returns -1 for days in between... that is cool Case2- for x and x+1 it returns 0 days in between ... got it. Case 3- for x and x+2 returns 1 day in between Now what happens if the date captured is at 11:59pm one day and 12:00am the next ... will it return 0 or -1? I am just trying to see if there are any quirks, I do know how to parse the ticks data. |
|
|||
|
CALVLUE and USERSTARTDATECAL_g are in Ticks
OffSet=1 'Get the True day index regardless of time date1= date(CALVLUE) date2=date(USERSTARTDATECAL_g) newdate1=DateParse(date1) + (TimeParse("00:00") mod cTicksPerDay) newdate2=DateParse(date2) + (TimeParse("00:00") mod cTicksPerDay) if newdate1 >= newdate2 then TheIndex = Int((newdate1-newdate2)/cTicksPerDay)+OffSet else Msgbox ("Please Enter A Date On or After Your Start Date of " &Date(USERSTARTDATECAL_g), Pname$, cMsgBoxOK) TheIndex=-1 end if Return TheIndex It works!!! |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| help with dates | adbftrainer | Questions & Help Needed | 3 | 08-31-2008 06:56 PM |
| Confused sorting on SQLLite dates | mikewhite | Questions & Help Needed | 4 | 08-18-2008 09:16 PM |
| What's The Difference? | Louis | Chit Chat | 1 | 03-08-2008 09:38 AM |
| How many days between two dates | pmu5757 | Questions & Help Needed | 3 | 09-21-2007 11:27 AM |
| How can i compare 2 Dates | Fontanus | Questions & Help Needed | 3 | 05-04-2007 10:37 PM |