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

@@ -602,7 +602,26 @@ void BaseExpression::esc(long double val, pt::TextStream & stream, const FT & fi
void BaseExpression::esc(const pt::Date & date, pt::TextStream & stream, const FT & field_type)
{
stream << date;
if( field_type.is_date_only() )
{
date.SerializeYearMonthDay(stream, false);
}
else
if( field_type.is_time_only() )
{
date.SerializeHourMinSec(stream);
}
else
{
if( field_type.is_no_time_zone() )
{
date.Serialize(stream);
}
else
{
date.SerializeISO(stream);
}
}
}