📜  excel 从日期获取月份 - 无论代码示例

📅  最后修改于: 2022-03-11 14:59:08.552000             🧑  作者: Mango

代码示例1
# A2 contains '15/09/2021'

# To get month from a date as a STRING
=TEXT(A2, "mm")             ' 9        (string)
=TEXT(A2, "mm")             ' 09    (string)
=TEXT(A2, "mmm")             ' sept
=TEXT(A2, "mmmm")             ' september

# To get month from a date as a NUMBER
=MONTH(DATE(2021,9,15))     ' 9        (number)
=MONTH(A2)                     ' 9        (number)