เวลา/ตัวเลข
เครื่องคำนวณผลต่างวันที่
ผลต่างที่แม่นยำระหว่างสองวันที่/เวลา — รายละเอียดตามปฏิทิน (ปี เดือน วัน…) ระยะเวลารวม และจำนวนวันทำการ
This tool calculates the exact difference between two dates and times: a calendar breakdown in years, months, and days, a total duration in a single unit (just days or hours), and separately, the number of business days excluding weekends.
How to use it
- Pick a start and end date (optionally with time and timezone) and the result is calculated instantly.
- The calendar breakdown reads naturally: "2 years, 3 months, 10 days" rather than just a raw day count.
- Business days are shown separately — weekends (Saturday and Sunday) are excluded from that count.
Common uses
- Working out how long a contract, warranty, or subscription runs in calendar units.
- Planning a project deadline in business days, excluding weekends.
- Calculating an age, tenure, or event duration down to the day.
Things to keep in mind
A calendar difference (years/months/days) depends on the actual dates involved — months have different lengths, so "1 month" can mean anywhere from 28 to 31 days.
The business-day count only excludes Saturday and Sunday — public holidays need to be subtracted manually if they matter for your calculation.
บทความเกี่ยวกับเครื่องมือนี้: ผลต่างวันที่: เหตุใดการนับวันจึงซับซ้อนกว่าที่คิด
คำถามที่พบบ่อย
ผลต่างคำนวณรวมหรือไม่รวมวันที่สิ้นสุด?
เครื่องมือคำนวณผลต่างทางดาราศาสตร์ระหว่างสองจุดเวลา (ไม่รวม) — ดังนั้น "ตั้งแต่วันที่ 1 ถึงวันที่ 3" จะได้ 2 วัน ไม่ใช่ 3 หากต้องการจำนวนวันตามปฏิทินรวมทั้งสองวันที่ ให้บวกเพิ่มอีกหนึ่งวัน
เดือนและปีที่มีความยาวต่างกันถูกจัดการอย่างไร?
ผลต่างตามปฏิทิน (ปี/เดือน/วัน) คำนวณแบบเดียวกับที่คนนับบนปฏิทิน: ก่อนอื่นลบปีและเดือนเต็มโดยคำนึงถึงความยาวจริง ส่วนที่เหลือแสดงเป็นวัน
"วันทำการ" หมายถึงอะไร?
จำนวนวันจันทร์ถึงศุกร์ในช่วงเวลาที่เลือก วันหยุดราชการไม่ถูกนับรวมเพราะแตกต่างกันไปในแต่ละประเทศ
ทำไมเครื่องมือต่างกันจึงให้ผลต่างเป็นเดือนต่างกันใกล้เดือนสั้น?
การลบหนึ่งเดือนจากวันที่ที่ไม่มีอยู่ในเดือนก่อนหน้า (เช่น 31 มีนาคมลบหนึ่งเดือน) มีความคลุมเครือ — บางไลบรารีปัดเป็นวันสุดท้ายของกุมภาพันธ์ บางไลบรารีเลื่อนวันที่เกินไปยังต้นเดือนมีนาคม ทั้งสองแนวทางมีเหตุผล แต่ให้ผลลัพธ์ต่างกัน
ฉันสามารถคำนวณผลต่างสำหรับวันที่ในอดีตก่อนปี 1970 ได้หรือไม่?
ได้ การคำนวณไม่ได้จำกัดอยู่แค่ยุค Unix และทำงานได้อย่างถูกต้องสำหรับวันที่ตามปฏิทินใดก็ได้ รวมถึงวันที่ก่อนปี 1970