Calculation Number of Days Between Two Dates

Calculation Number of Days Between Two Dates

Topic:

Delphi Language

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

Calculation Number of Days Between Two Dates 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

Calculation Number of Days Between Two Dates


  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

Calculation Number of Days Between Two Dates


  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

Calculation Number of Days Between Two Dates


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

Calculation Number of Days Between Two Dates

  1. Calculation Number of Days Between Two Dates
    Sent by e-ric

  2. 1

    2

    3

    4

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

Calculation Number of Days Between Two Dates


  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

Calculation Number of Days Between Two Dates


  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

Calculation Number of Days Between Two Dates 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

You May Also Like

Top Benefits of Social Media Marketing

We cannot deny the fact that when it comes to marketing, social…

World of Warcraft Classic: Some Players Use Illegal Tools to Stay Connected

Earlier this week, Blizzard released World of Warcraft Classic. The launch was,…

Crash Team Racing Bientt Back on Ps4!

Activision seems not to have finished with the remastering of the Playstation…

The Brutal Murder Story Of Osmania Student Leader George Reddy-Beginning

“When many a head will tumble down beneath your ruthless sword.. Those…