---
title: Date.DaysInMonth – หาจำนวนวันในเดือน
url: https://www.thepexcel.com/functions/power-query/date-functions/date-daysinmonth/
type: function-explainer
program: Power Query
syntax: Date.DaysInMonth(dateTime as any) as nullable number
date: 2025-12-03
updated: 2025-12-17
scores:
  popularity: 5
  difficulty: 2
  usefulness: 5
---

# Date.DaysInMonth – หาจำนวนวันในเดือน

> หาจำนวนวันในเดือน

## คำอธิบาย

คืนค่าจำนวนวันในเดือนของวันที่กำหนด

## Syntax

```excel
Date.DaysInMonth(dateTime as any) as nullable number
```

## Arguments

| Name | Required | Type | Default | Description |
| --- | --- | --- | --- | --- |
| dateTime | Yes | date |  | วันที่ |

## ตัวอย่าง

### 1. กุมภาพันธ์ 2024

```excel
Date.DaysInMonth(#date(2024,2,1))
```

**ผลลัพธ์:** `29`

ปี 2024 เป็นปีอธิกสุรทิน เดือน ก.พ. มี 29 วัน

## ฟังก์ชันที่เกี่ยวข้อง

- [Date.EndOfMonth – หาวันสิ้นเดือน](https://www.thepexcel.com/functions/power-query/date-functions/date-endofmonth/)
- [Date.Month – ดึงเดือนจากวันที่](https://www.thepexcel.com/functions/power-query/date-functions/date-month/)

## แหล่งข้อมูลเพิ่มเติม

- [PowerQuery.how](https://powerquery.how/date-daysinmonth/) _(guide)_

---

_Source: [https://www.thepexcel.com/functions/power-query/date-functions/date-daysinmonth/](https://www.thepexcel.com/functions/power-query/date-functions/date-daysinmonth/)_
