# Calculation Number of Days Between Two Dates

Topic:

## Delphi Language

1. charlene44 wrote: 18/08/2006 at 15h08

## calculation of number of days between two dates

1. good morning,
2. I have a small problem: I have dates stored in my database in date format, and with two dates I would like to find the number of days between them, so get an integer, how can I calculate that? thank you in advance.
3. Ben_Le_Cool wrote: 18/08/2006 at 3:13pm

1. Hi,
2. You can use the DaysBetween feature. That gives you the number of whole days between two TDateTimes.
3. function DaysBetween(const ANow, AThen: TDateTime): Integer;
4. e-ric wrote: 18/08/2006 at 15:22 pm

1. The previous answer is valid if you manipulate the dates in the Delphi code as TDateTime from Delphi 6 onwards otherwise
2. 1

2

3

4

5
3. charlene44 wrote: 19/08/2006 at 02:11am

1. thank you very much, I’ll try that!
2. edam wrote: 19/08/2006 at 02:24am

1. Sent by e-ric

2. 1

2

3

4

5
3. charlene44 wrote: 19/08/2006 at 02:36am

1. ba it works anyway, thank you very much, it gives this, I made an example very quickly to test, it’s not at all optimized but it’s okay, it gives : this
2. edam wrote: 19/08/2006 at 02:49am

1. on the contrary this code given by eric that I prefer, and even sometimes I change all the dates and hours in integrate to facilitate the calculation
2. mafuku wrote: 21/08/2012 at 3:06pm

## Difference between two dates

1. The example is made with two TDatetimePicker components that send their values to the variables p1 and p2. Just an addition to what already exists.
2. 1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

## October 7, US Election Wrap: Trump cries foul over the FDA vaccine guidelines

Written by Neha Banka |October 7, 2020 1:10:37 pm US President Donald Trump. (Reuters) Information stories recommend…

## The Very Best Tax Obligation Software Application Reviewed for 2020

It’s everybody’s the very least preferred season: tax obligation period. In between anxiously looking for your tax return,…

## Record Majors Get the Blocking of Extratorrent, Torrent9, Isohunt and Cpasbien

Before the Tribunal de Grande Instance of Paris, the Société Civile des Producteurs Phonographiques (SCPP) obtained the blocking…

## [problem] Mms Reception Impossible!

Good morning, I had the same problem when I switched to android 4.x. On gingerbread everything worked fine,…