🐍

Python DD/MM/YYYY

Izlaz: 15/01/2025
Brza referenca
Niz formata
%d/%m/%Y
Izlaz
15/01/2025

Formatiraj datum kao DD/MM/YYYY u Python

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

Parsiraj niz datuma

🐍 Python (Parsiranje)
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:00

Kodovi formata datuma u Python

Kod Značenje Primer
%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

Ostali formati u Python

DD/MM/YYYY u drugim jezicima

Zvanična dokumentacija

Za više informacija o formatiranju datuma u Python, pogledajte zvaničnu dokumentaciju:

Dokumentacija datuma za Python →

Povezane stranice