#django review/views.py
review.created_at.strftime('%Y''-''%m''-''%d')
code | 의미 | 예 |
---|---|---|
%a | 요일을 로케일의 축약된 이름으로. | Sun, Mon, …, Sat(en_US) So, Mo, …, Sa (de_DE) |
%A | 요일을 로케일의 전체 이름으로. | Sunday, Monday, …, Saturday (en_US) Sonntag, Montag, …, Samstag (de_DE) |
%w | 요일을 10진수로, 0은 일요일이고 6은 토요일입니다. | 0, 1, …, 6 |
%d | 월중 일(day of the month)을 0으로 채워진 10진수로. | 01, 02, …, 31 |
%b | 월을 로케일의 축약된 이름으로. | Jan, Feb, …, Dec (en_US) Jan, Feb, …, Dez (de_DE) |
%B | 월을 로케일의 전체 이름으로. | January, February, …, December (en_US) Januar, Februar, …, Dezember (de_DE) |
%m | 월을 0으로 채워진 10진수로. | 01, 02, …, 12 |
%y | 세기가 없는 해(year)를 0으로 채워진 10진수로. | 00, 01, …, 99 |
%Y | 세기가 있는 해(year)를 10진수로. | 0001, 0002, …, 2013, 2014, …, 9998, 9999 |
%H | 시(24시간제)를 0으로 채워진 십진수로. | 00, 01, …, 23 |
%I | 시(12시간제)를 0으로 채워진 십진수로. | 01, 02, …, 12 |
%p | 로케일의 오전이나 오후에 해당하는 것. | AM, PM (en_US) am, pm (de_DE) |
%M | 분을 0으로 채워진 십진수로. | 00, 01, …, 59 |
%S | 초를 0으로 채워진 10진수로. | 00, 01, …, 59 |
%f | Microsecond as a decimal number, zero-padded to 6 digits. | 000000, 000001,…, 999999 |
%z | ±HHMM[SS[.ffffff]] 형태의 UTC 오프셋 (객체가 나이브하면 빈 문자열). | (비어 있음), +0000, -0400, +1030, +063415, -030712.345216 |
%Z | 시간대 이름 (객체가 나이브하면 빈 문자열). | (비어 있음), UTC, GMT |
%j | 연중 일(day of the year)을 0으로 채워진 십진수로. | 001, 002, …, 366 |
%U | Week number of the year (Sunday as the first day of the week) as a zero-padded decimal number. All days in a new year preceding the first Sunday are considered to be in week 0. | 00, 01, …, 53 |
%W | Week number of the year (Monday as the first day of the week) as a zero-padded decimal number. All days in a new year preceding the first Monday are considered to be in week 0. | 00, 01, …, 53 |
%c | 로케일의 적절한 날짜와 시간 표현. | Tue Aug 16 21:30:00 1988 (en_US) Di 16 Aug 21:30:00 1988 (de_DE) |
%x | 로케일의 적절한 날짜 표현. | 08/16/88 (None) 08/16/1988 (en_US) 16.08.1988 (de_DE) |
%X | 로케일의 적절한 시간 표현. | 21:30:00 (en_US) 21:30:00 (de_DE) |
%% | 리터럴 '%' 문자. | % |
참고 : https://docs.python.org/ko/3/library/datetime.html#strftime-strptime-behavior
오!! 역시 한구님 정리왕!!!