You are not logged in.
Pages: 1
Hi, (latest mormot from github, D11.2ent)
if I do:
var isotime: TSynSystemTime;
if isotime.FromText('1962-11-12T21:59:48') then
or
if isotime.FromText('1962-11-12T21:59:48.000') then
result is false, because milliseconds are always 2333.
intialization of values are random numbers (milliseconds are 2333). Also year, ...
Maybe I'm missing soemthing.
thank you,
Vojko
Last edited by VojkoCendak (2023-06-14 07:13:29)
Offline
Yes, but the milliseconds are always 2333 (in my case) and the fuction ToDateTime fails,
because TryEncodeTime fails because milliseconds are greater then 1000.
maybe they should be always 0 then.
Last edited by VojkoCendak (2023-06-14 07:16:15)
Offline
Even if I use date only, milliseconds part is fixed in some random number:
isotime.FromText('1962-11-13');
dt := isotime.ToDateTime; // fails, because of millisecond part
function TSynSystemTime.ToDateTime: TDateTime;
var time: TDateTime;
begin
if TryEncodeDate(Year,Month,Day,result) then
if TryEncodeTime(Hour,Minute,Second,MilliSecond,time) then // fails !
result := result+time else
result := 0 else
result := 0;
end;
thank you
Offline
Please try https://github.com/synopse/mORMot/commit/25605342
(also backported on mORMot 2 via https://github.com/synopse/mORMot2/commit/42f36e34 )
Offline
yes it works. thank you
Offline
Pages: 1