🐍
Python DD/MM/YYYY
આઉટપુટ: 15/01/2025
ઝડપી સંદર્ભ
ફોર્મેટ સ્ટ્રિંગ
%d/%m/%Y
આઉટપુટ
15/01/2025
Python માં DD/MM/YYYY તરીકે તારીખ ફોર્મેટ કરો
🐍 Python
from datetime import datetime
date = datetime.now()
formatted = date.strftime('%d/%m/%Y')
print(formatted) # Output: 31/12/2025તારીખ સ્ટ્રિંગ પાર્સ કરો
🐍 Python (પાર્સિંગ)
from datetime import datetime
date_string = '31/12/2025'
date = datetime.strptime(date_string, '%d/%m/%Y')
print(date) # Output: 2025-12-31 00:00:00Python તારીખ ફોર્મેટ કોડ્સ
| કોડ | અર્થ | ઉદાહરણ |
|---|---|---|
| %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 માં અન્ય ફોર્મેટ્સ
અન્ય ભાષાઓમાં DD/MM/YYYY
સત્તાવાર દસ્તાવેજીકરણ
Python માં તારીખ ફોર્મેટિંગ વિશે વધુ માહિતી માટે, સત્તાવાર દસ્તાવેજીકરણ જુઓ: