Get month from DATETIME in sqlite

前端 未结 7 1386
温柔的废话
温柔的废话 2020-12-01 16:28

I am trying to get extract the month from a DATETIME field in SQLite. month(dateField) does not work as well as strftime(\'%m\', dateStart)

7条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-01 16:55

    Try using the following:

    select strftime('%m', datetime(datefield, 'unixepoch')) as month from table
    

提交回复
热议问题