Different processing of datetime in different databases
Peewee datetime field exposes properties like `.year` which use a db-specific extract (or equivalent) function. So you can write:

```python

query = (DataModel
         .select(DataModel.d_t.year, fn.SUM(DataModel.val))
         .where(...)
         .group_by(DataModel.d_t.year))
```

Relevant docs: http://docs.peewee-orm.com/en/latest/peewee/models.html#datetimefield-datefield-and-timefield
I'm writing something related to statistics. I don't want to limit the database. Different databases handle different dates and times.

I tested extract_ However, different databases need to be dealt with separately, resulting in the following problems:

1.How to get the database type of the model;
2.If I want to be compatible with all the databases supported by peewee, which date function is better;

Here are some code snippets:
```
from peewee import *

database_proxy = DatabaseProxy()

database = SqliteDatabase(':memory:')


class StatisticsDataModel(Model):
    mid = IntegerField()
    d_t = DateTimeField()
    val = IntegerField()

    class Meta:
        table_name = 'statistics_data'
        database = database_proxy

def sum_format(mid, start, end):
    format_d_t = fn.Year(StatisticsDataModel.d_t).alias('format_d_t')
    query = StatisticsDataModel.select(
        format_d_t,
        fn.SUM(StatisticsDataModel.val),
    ).where(
        StatisticsDataModel.mid == mid,
        StatisticsDataModel.d_t >= start,
        StatisticsDataModel.d_t <= end,
    ).group_by(format_d_t)
    return query.execute()
```

------------

The above is translated by software!