🐍

Python MM/DD/YYYY

ผลลัพธ์: 01/15/2025
อ้างอิงด่วน
รูปแบบสตริง
%m/%d/%Y
ผลลัพธ์
01/15/2025

จัดรูปแบบวันที่เป็น MM/DD/YYYY ใน Python

🐍 Python
from datetime import datetime date = datetime.now() formatted = date.strftime('%m/%d/%Y') print(formatted) # Output: 12/31/2025

รหัสรูปแบบวันที่ Python

รหัส ความหมาย ตัวอย่าง
%d Day of month (01-31) 31
%m Month (01-12) 12
%Y Year with century 2025
%y Year without century (00-99) 25
%b Abbreviated month name Dec
%B Full month name December
%a Abbreviated weekday Wed
%A Full weekday name Wednesday

รูปแบบอื่นๆ ใน Python

MM/DD/YYYY ในภาษาอื่น

เอกสารอย่างเป็นทางการ

สำหรับข้อมูลเพิ่มเติมเกี่ยวกับการจัดรูปแบบวันที่ใน Python ดูเอกสารอย่างเป็นทางการ:

เอกสารวันที่ Python →

หน้าที่เกี่ยวข้อง