[Lazarus] Date value 0
Kamen Ketev
kamenlist at abv.bg
Wed May 27 10:32:15 CEST 2015
Yes but there is an error on converting date before 12/30/1899: it add 1 day. For example 27.09.1389 converts to
28.09.1389. For date after
12/30/1899 there is no problem. I am using following code:
var s, S1: string; dt: TDateTime;
S1 := ListItem.SubItems[1]; S1 := trim(S1);
dt := StrtoDate(s) + StrToTime(S1);
s := FormatDateTime('dd.mm.yyyy hh.nn.ss', dt);
with Form1 do Begin
year.Text := copy(s, 7, 4);
month.Text := copy(s, 4, 2);
day.Text := copy(s, 1, 2);
Or something wrong in my code?
Regards,
Kamen
-------- Оригинално писмо --------
От: Michael Van Canneyt
Относно: Re: [Lazarus] Date value 0
До: Lazarus mailing list
Изпратено на: Сряда, 2015, Май 27 10:55:23 EEST
On Wed, 27 May 2015, Kamen Ketev wrote:
>
> How can I use
TDateTime for date before
"12/30/1899 12:00 am". I need it for astronomical calculations. Is it possible to be add flag or something else to ignore this border?
You can use TDateTime for this, there is no problem with values < 0.
Michael.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20150527/e35ec313/attachment-0003.html>
More information about the Lazarus
mailing list