#Error while converting time to utc and cannot compare two time:civil objects

1 messages · Page 1 of 1 (latest)

karmic snow
#

Hi I tried Bal persist in a ballerina project and time:Civil type to store time in MySQL database. But I want to compare two times to filter data in bal persist. When I try to do it it shows error as "operator '<' not defined for 'ballerina/time:2.2.4:Civil' and 'ballerina/time:2.2.4:Civil' ". Then I try to convert it to Utc type using time:utcFromCivil() method. But it outputs an error as "Error while converting time to utc" error = "civilTime.utcOffset must not be null".

Is there way to add time:Utc type in bal persist or compare two time:Civil types? Or any other suggestions for this?

Thanks.

elfin tide