Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help calculating number of days between 2 dates
Message
From
05/04/2003 04:43:48
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
05/04/2003 04:01:31
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00774382
Message ID:
00774384
Views:
19
>Hi all,
>
>Can anyone explain how to calculate the difference between two dates where the result is number of days difference?
>
>Example:
>Date1 - Date2 = xDays where Date1 is always older than Date2
>10/10/02 - 12/12/02 = ?days
>
>Thanks,
>
>Scott

? dDate2 - dDate1

? date() - {^2003/1/1} && Days past since year start 2003
? date() - 1 && Yesterday as date
? date() + 1 && Tomorrow as date

In VFP subtraction is overloaded to work on dates too.
If you subtract 2 date values you get difference in days (if lte 0 than then first date is older).
If you subtract/add a numeric from a date you get n days before/after date.
It operates on datetime too but then difference is in seconds not days.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform