add FT::date_only, FT::time_only and FT::no_time_zone flags

This commit is contained in:
2022-10-22 16:29:40 +02:00
parent 38e790c2ac
commit 0ce05850b3
7 changed files with 55 additions and 19 deletions

View File

@@ -850,7 +850,20 @@ void DbConnector::get_value(const char * value_str, long double & field_value, c
void DbConnector::get_value(const char * value_str, pt::Date & field_value, const FT & field_type)
{
// IMPROVE ME give some log if parsing failed
field_value.Parse(value_str);
if( field_type.is_date_only() )
{
field_value.ParseDayMonthYear(value_str);
}
else
if( field_type.is_time_only() )
{
field_value.ParseHourMinSec(value_str);
}
else
{
field_value.Parse(value_str, !field_type.is_no_time_zone());
}
}