워드프레스에서 글을 발행한 날짜, 시각 출력
워드프레스
2010/12/18 18:59
워드프레스 테마에 다음과 같이 코드를 넣으면 글을 발행한 날짜가 '2010.3.2 17:00'과 같은 꼴로 나온다.
글을 작성한 시각이 2010-03-02 17:00:24일 때 the_time() 안에 들어가는 인수에 따라 다음처럼 출력된다.
<?php the_time('Y.n.j ') ?><?php the_time() ?>글을 작성한 시각이 2010-03-02 17:00:24일 때 the_time() 안에 들어가는 인수에 따라 다음처럼 출력된다.
<?php the_time('c') ?>2010-03-02T17:00:24+00:00<?php the_time('r') ?>Tue, 02 Mar 2010 17:00:24 +0000<?php the_time() ?>17:00 - 시와 분<?php the_time('Y') ?>2010 - 네 자리 해<?php the_time('y') ?>10 - 두 자리 해<?php the_time('F') ?>3월 또는 March<?php the_time('m) ?>03 - 0을 붙이는 두 자리 달<?php the_time('n') ?>3 - 0을 붙이지 않은 달<?php the_time('d') ?>02 - 0을 붙이는 두 자리 날<?php the_time('j') ?>2 - 0을 붙이지 않은 날<?php the_time('w') ?>2 - 0을 불이지 않은 날<?php the_time('D') ?>Tue - 영문식 요일<?php the_time('l') ?>월요일 또는 Monday<?php the_time('a') ?>오후 - 오전·오후 또는 am·pm<?php the_time('h') ?>05 - 오전/오후를 구분한 두 자리 시<?php the_time('g') ?>5 - 오전/오후를 구분한 시<?php the_time('i') ?>00 - 0을 붙이는 두자리 분<?php the_time('I') ?>0 - 0을 붙이지 않는 분<?php the_time('s') ?>24 - 0을 붙이는 두자리 초<?php the_time('G') ?>1267549224 - 유닉스 시간(Unix time)<?php the_time('U') ?>1267549224 - 유닉스 시간(Unix time)<?php the_time('e') ?>UTC<?php the_time('T') ?>UTC<?php the_time('o') ?>2010<?php the_time('O') ?>+0000<?php the_time('P') ?>+00:00<?php the_time('t') ?>31 - 그 달의 날 수<?php the_time('u') ?>000000<?php the_time('W') ?>09<?php the_time('z') ?>60<?php the_time('Z') ?>0
![미리보기 그림 - [워드프레스] sunrise.php 파일이 없어서 나오는 경고문](/image/4056_2.png)
덧글을 달아 주세요