TryRFC3339ToDateTime raise Error
Original Reporter info from Mantis: lxpbuaa
-
Reporter name: lxpbuaa
Original Reporter info from Mantis: lxpbuaa
- Reporter name: lxpbuaa
Description:
Hi,
With the datetime D='2020-10-24 10:00',
var S := FormatDateTime(yyyy-mm-dd"T"hh:nn:ss, D). //S is '2020-10-24T10:00', it doesn't contain seconds.
TryRFC3339ToDateTime(S) will raise a error,
In TryRFC3339ToDateTime:
lH:=StrToIntDef(Copy(AValue,P[ppHour],2),-1);
lMi:=StrToIntDef(Copy(AValue,P[ppMinute],2),-1);
lS:=StrToIntDef(Copy(AValue,P[ppSec],2),-1);
It is required that these hour, minute and second cannot be empty. I suggest changing the param - 1 to 0, or modifing the function FormatDateTime to include seconds.
Thanks!
Mantis conversion info:
- Mantis ID: 37974
- Build: 1.4.32
- Fixed in version: trunk
- Fixed in revision: 918