This commit factorizes how the format is computed for ODOO.PIVOT and ODOO.PIVOT.HEADER functions. It was essentially duplicated. Also move the date(time) format responsibilty to each time adapters, instead of handling the different aggregate cases separatly. This commit also prepares the next commit which fixes a formatting bug. Task: 3570281 Part-of: odoo/odoo#139295