[fpc-pascal] DefaultFormatSettings usage

silvioprog silvioprog at gmail.com
Wed Feb 5 03:18:14 CET 2014


2014-02-05 silvioprog <silvioprog at gmail.com>:

> 2014-02-04 Marco van de Voort <marcov at stack.nl>:
>
> In our previous episode, silvioprog said:
>> > Worked with:
>> >
>> > var
>> >   t: TDateTime;
>> > begin
>> >   t := StrToDateTime('2013-02-04 11:39:54');
>> > end;
>> >
>> > sorry, I forgot to use the function StrToDateTime. :S
>>
>> Or use
>>
>> http://www.freepascal.org/docs-html/rtl/dateutils/scandatetime.html
>
>
> Very nice option, I did not know this function. It would be better (or
> fast) that the SysUtils date funcs? For example, in my new units, would be
> better to use ScanDateTime instead of StrToDateTime?
>
> Thx Marco!  :)
>

It would be nice if you could:

  if TryScanDateTime(datestring, datetime) then
    raise EMyOwnExcept.Create('My own datetime exception message');

-- 
Silvio Clécio
My public projects - github.com/silvioprog
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20140205/f7e63ad9/attachment.html>


More information about the fpc-pascal mailing list