- function format_time ($time, $format)
- {
- $time = preg_replace("/[^0-9]/", "", $time);
-
- if (strlen($time) >= 8)
- {
- $regday1 = trim(substr($time,0,4)); // ³â
- $regday2 = trim(substr($time,4,2)); // ¿ù
- $regday3 = trim(substr($time,6,2)); // ÀÏ
- $regday4 = trim(substr($time,8,2)); // ½Ã
- $regday5 = trim(substr($time,10,2)); // ºÐ
- $regday6 = trim(substr($time,12,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;
- }
³¯Â¥ Æ÷¸Ë º¯°æ ÇÔ¼ö
ÇÔ¼ö¸í : format_time() ¼³¸í : - Æ÷¸Ë Çü½Ä Y : ³â, M : ¿ù, D : ÀÏ, S : ½Ã, m : ºÐ, ÃÊ : S - format_time( $½Ã°£°ª, "Æ÷¸Ë Çü½Ä");
»ç¿ë¹æ¹ý : »ç¿ë¿¹ -> format_time( $INSERT_TIME, "YYYY.MM.DD SS:mm"); °á°ú°ª -> 2012.11.21 04:23
ºñ°í : ¿¹Àü¿¡ ¿Ã·È´ø ¹öÀü 1°úÀÇ Â÷ÀÌÁ¡Àº.. º¸³»´Â µ¥ÀÌÅÍÀÇ ³¯Â¥ Çü½ÄÀÌ º¸´Ù ÀÚÀ¯·Î¿ö Á³´Ù! |