Enum DateTimeGroupingRuleType
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
DateTimeGroupingRuleType
ประเภทของกฎการจัดกลุ่มวันที่และเวลา
ตัวอย่างด้านล่างจะถือว่าสเปรดชีต locale
เป็น "en-US" ระบบอาจแปลที่เก็บข้อมูลการจัดกลุ่มตามภาษาของสเปรดชีต
หากต้องการเรียกใช้ enum ให้เรียกคลาสหลัก ชื่อ และพร็อพเพอร์ตี้ของ enum นั้น เช่น
SpreadsheetApp.DateTimeGroupingRuleType.SECOND
พร็อพเพอร์ตี้
พร็อพเพอร์ตี้ | ประเภท | คำอธิบาย |
UNSUPPORTED | Enum | ประเภทกฎการจัดกลุ่มวันที่และเวลาที่ระบบไม่รองรับ |
SECOND | Enum | จัดกลุ่มวันที่และเวลาตามวินาทีจาก 0 ถึง 59 |
MINUTE | Enum | จัดกลุ่มวันที่และเวลาตามนาทีจาก 0 ถึง 59 |
HOUR | Enum | จัดกลุ่มวันที่และเวลาตามชั่วโมงโดยใช้ระบบ 24 ชั่วโมง ตั้งแต่ 0 ถึง 23 |
HOUR_MINUTE | Enum | จัดกลุ่มวันที่และเวลาตามชั่วโมงและนาทีโดยใช้ระบบ 24 ชั่วโมง เช่น 19:45 |
HOUR_MINUTE_AMPM | Enum | จัดกลุ่มวันที่และเวลาตามชั่วโมงและนาทีโดยใช้ระบบ 12 ชั่วโมง เช่น 7:45 PM |
DAY_OF_WEEK | Enum | จัดกลุ่มวันที่และเวลาตามวันในสัปดาห์ เช่น Sunday |
DAY_OF_YEAR | Enum | จัดกลุ่มวันที่และเวลาตามวันของปี ตั้งแต่ 1 ถึง 366 |
DAY_OF_MONTH | Enum | จัดกลุ่มวันที่และเวลาตามวันของเดือน ตั้งแต่ 1 ถึง 31 |
DAY_MONTH | Enum | จัดกลุ่มวันที่และเวลาตามวันและเดือน เช่น 22-Nov |
MONTH | Enum | จัดกลุ่มวันที่และเวลาตามเดือน เช่น Nov |
QUARTER | Enum | จัดกลุ่มวันที่และเวลาตามไตรมาส เช่น Q1 (ซึ่งหมายถึงม.ค. - มี.ค.) |
YEAR | Enum | จัดกลุ่มวันที่และเวลาตามปี เช่น 2008 |
YEAR_MONTH | Enum | จัดกลุ่มวันที่และเวลาตามปีและเดือน เช่น 2008-Nov |
YEAR_QUARTER | Enum | จัดกลุ่มวันที่และเวลาตามปีและไตรมาส เช่น 2008 Q4 |
YEAR_MONTH_DAY | Enum | จัดกลุ่มวันที่และเวลาตามปี เดือน และวัน เช่น 2008-11-22 |
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-26 UTC
[null,null,["อัปเดตล่าสุด 2025-07-26 UTC"],[[["\u003cp\u003e\u003ccode\u003eDateTimeGroupingRuleType\u003c/code\u003e defines how date and time values are grouped in Google Sheets, like by hour, month, or year.\u003c/p\u003e\n"],["\u003cp\u003eThese grouping rules influence how data is organized and summarized, impacting features such as pivot tables and charts.\u003c/p\u003e\n"],["\u003cp\u003eYou can access these rule types using \u003ccode\u003eSpreadsheetApp.DateTimeGroupingRuleType\u003c/code\u003e followed by the specific rule, such as \u003ccode\u003eSpreadsheetApp.DateTimeGroupingRuleType.SECOND\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eGrouping buckets might be translated based on the spreadsheet's locale setting.\u003c/p\u003e\n"]]],[],null,["# Enum DateTimeGroupingRuleType\n\nDateTimeGroupingRuleType\n\nThe types of date-time grouping rule.\n\nThe examples below assume the spreadsheet [locale](/apps-script/reference/spreadsheet/spreadsheet#getSpreadsheetLocale())\nis \"en-US\", grouping bucket may be translated based on the spreadsheet locale.\n\nTo call an enum, you call its parent class, name, and property. For example, `\nSpreadsheetApp.DateTimeGroupingRuleType.SECOND`. \n\n### Properties\n\n| Property | Type | Description |\n|--------------------|--------|-----------------------------------------------------------------------------------|\n| `UNSUPPORTED` | `Enum` | A date-time grouping rule type that is not supported. |\n| `SECOND` | `Enum` | Group date-time by second, from 0 to 59. |\n| `MINUTE` | `Enum` | Group date-time by minute, from 0 to 59. |\n| `HOUR` | `Enum` | Group date-time by hour using a 24-hour system, from 0 to 23. |\n| `HOUR_MINUTE` | `Enum` | Group date-time by hour and minute using a 24-hour system, for example `19:45`. |\n| `HOUR_MINUTE_AMPM` | `Enum` | Group date-time by hour and minute using a 12-hour system, for example `7:45 PM`. |\n| `DAY_OF_WEEK` | `Enum` | Group date-time by day of week, for example `Sunday`. |\n| `DAY_OF_YEAR` | `Enum` | Group date-time by day of year, from 1 to 366. |\n| `DAY_OF_MONTH` | `Enum` | Group date-time by day of month, from 1 to 31. |\n| `DAY_MONTH` | `Enum` | Group date-time by day and month, for example `22-Nov`. |\n| `MONTH` | `Enum` | Group date-time by month, for example `Nov`. |\n| `QUARTER` | `Enum` | Group date-time by quarter, for example Q1 (which represents Jan-Mar). |\n| `YEAR` | `Enum` | Group date-time by year, for example 2008. |\n| `YEAR_MONTH` | `Enum` | Group date-time by year and month, for example `2008-Nov`. |\n| `YEAR_QUARTER` | `Enum` | Group date-time by year and quarter, for example `2008 Q4` . |\n| `YEAR_MONTH_DAY` | `Enum` | Group date-time by year, month, and day, for example `2008-11-22`. |"]]