Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> การเขียนโปรแกรม >> Python

Python Modules สำหรับ Date Manipulation มีอะไรบ้าง

มี Modules หลายตัวใน Standard Library และ PyPI สำหรับ Date Manipulation ยอดนิยมมีดังนี้:

  • datetime (Standard Library): Classes สำหรับ Manipulate Dates/Times ทั้ง Simple และ Complex รองรับ Date/Time Arithmetic โฟกัสที่ Efficient Attribute Extraction
  • time (Standard Library): Time-related Functions เรียก Platform C Library Functions
  • dateutil: Powerful Extensions สำหรับ datetime Module มีใน Python 2.3+
  • mxDateTime: Python Extension Package ให้ Objects DateTime, DateTimeDelta, RelativeDateTime จัดการ Date/Time طبيعيةกว่า Ticks
  • pytz: Olson tz Database ใน Python Accurate Cross-platform Timezone Calculations Python 2.4+ แก้ Ambiguous Times ตอนจบ DST