-
function format_time ($time, $format)
-
- {
- $regday1 = trim(substr($time,0,4)); // ³â
- $regday2 = trim(substr($time,5,2)); // ¿ù
- $regday3 = trim(substr($time,8,2)); // ÀÏ
- $regday4 = trim(substr($time,11,2)); // ½Ã
- $regday5 = trim(substr($time,14,2)); // ºÐ
- $regday6 = trim(substr($time,17,2)); // ÃÊ
-
-
- if($format)
- {
- $format = str_replace("YYYY",$regday1,$format); // ³â
- $format = str_replace("MM",$regday2,$format); // ¿ù
- $format = str_replace("DD",$regday3,$format); // ÀÏ
- $format = str_replace("HH",$regday4,$format); // ½Ã
- $format = str_replace("mm",$regday5,$format); // ºÐ
- $format = str_replace("SS",$regday6,$format); // ÃÊ
-
-
- $pday = $format;
- }
-
-
- if($time) return $pday;
- else return;
- }
<B>³¯Â¥ Æ÷¸Ë º¯°æ ÇÔ¼ö</B>
ÇÔ¼ö¸í : format_time()
¼³¸í :
- Æ÷¸Ë Çü½Ä Y : ³â, M : ¿ù, D : ÀÏ, S : ½Ã, m : ºÐ, ÃÊ : S
- format_time( $½Ã°£°ª, "Æ÷¸Ë Çü½Ä");
»ç¿ë¹æ¹ý :
»ç¿ë¿¹ -> format_time( $INSERT_TIME, "YYYY.MM.DD SS:mm");
°á°ú°ª -> 2012.11.21 04:23
|