Get month from DATETIME in sqlite

前端 未结 7 1341
温柔的废话
温柔的废话 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:37

    I guess strftime('%m', dateStart) is not working for you because dateStart variable is date/datetime type.

    Then you must use:

    strftime('%m', date(dateStart))
    

提交回复
热议问题