Recent

Author Topic: TDateTime from 12 december 1899; whi?  (Read 4509 times)

corradoventu

  • New member
  • *
  • Posts: 7
TDateTime from 12 december 1899; whi?
« on: January 15, 2017, 03:49:15 pm »
in: https://www.daniweb.com/programming/software-development/threads/103675/tutorial-handling-dates-and-time-in-delphi i find:
Delphi 2.0 and later supply the TDateTime format, which is actually a floating point number (stored as a IEEE double) containing the number of days that have passed since 12 December 1899.
why 12 December 1899? this date has a special meaning?
thanks.
With or without religion, good people can behave well and bad people can do evil; but for good people to do evil — that takes religion.

rvk

  • Hero Member
  • *****
  • Posts: 6111
Re: TDateTime from 12 december 1899; whi?
« Reply #1 on: January 15, 2017, 03:56:46 pm »
That's a big error in that article.
It should be 30 december 1899.

My guess is that somebody misread 12/30/1899 as 12 december (which it is not)
but because in lots of Europe it is written as 30/12/1899 they thought the first digit was the day.

See the manual of Delphi.
Quote
The integral part of a System::TDateTime value is the number of days that have passed since 12/30/1899. The fractional part of a System::TDateTime value is the time of day.

Originally it should have been 31th but because of some misconception about 1900 being a leap-year (which it is not) it eventuelly became 30th december.
See explanation here: http://www.delphibasics.co.uk/RTL.asp?Name=TDateTime

wp

  • Hero Member
  • *****
  • Posts: 11856
Re: TDateTime from 12 december 1899; whi?
« Reply #2 on: January 15, 2017, 03:58:16 pm »
No, it's not Dec 12 1899, but Dec 30 1899.

See the discussion in http://forum.lazarus.freepascal.org/index.php/topic,34274.msg224211.html#msg224211.

molly

  • Hero Member
  • *****
  • Posts: 2330
Re: TDateTime from 12 december 1899; whi?
« Reply #3 on: January 15, 2017, 04:08:12 pm »
And in case it was not clear why jan 1st 1900 is such an *hmz* important date, woosh:)

 

TinyPortal © 2005-2018