Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2003-02

DateTimeToStr function... bug?

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Unknown author

Hi all,

Questions
1. units.pdf page 480 function DateTimeToStr
Statement says that this function returns the string equivalent of DateTime parameter using the ShortDateTimeFormat formatting..... but it looks like ShortDateTimeFormat is not defined anywhere rather ShortDateFormat. I assume this is a typo of the documentation. Can somebody please check?

2. Using
.....
ShortDateFormat := 'dddddd tt';
mmGoods.Lines.Add(DateTimeToStr(Now));
.....

gives a result of

27 February 2003 23:09:52 23:09
^^^^^^^^^ok^^^^^ ^^^ok^^^ ^???^

hour:minute is somewhat repeated but using this statement yields correct result

 mmGoods.Lines.Add(FormatDateTime('dddddd tt',Now));

27 February 2003 23:12:22

Is there a bug in DateTimeToStr subroutine????

fpc 1.0.7
Mandrake 9.1

Regards,

Yoyong

Reply by email