mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-02 01:52:10 +09:00
zdate 수정
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@4602 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
12453aee12
commit
617eebc0a4
1 changed files with 9 additions and 10 deletions
|
|
@ -297,9 +297,13 @@
|
|||
// 대상 시간이 없으면 null return
|
||||
if(!$str) return;
|
||||
|
||||
$hour = (int)substr($str,8,2);
|
||||
|
||||
// 언어권에 따라서 지정된 날짜 포맷을 변경
|
||||
if($conversion == true) {
|
||||
switch(Context::getLangType()) {
|
||||
case 'ko' :
|
||||
$format = str_replace('a',($hour<=12)?'오전':'오후',$format);
|
||||
case 'en' :
|
||||
case 'es' :
|
||||
if($format == 'Y-m-d') $format = 'M d, Y';
|
||||
|
|
@ -309,6 +313,8 @@
|
|||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 년도가 1970년 이전이면 별도 처리
|
||||
if((int)substr($str,0,4) < 1970) {
|
||||
|
|
@ -318,22 +324,15 @@
|
|||
$year = (int)substr($str,0,4);
|
||||
$month = (int)substr($str,4,2);
|
||||
$day = (int)substr($str,6,2);
|
||||
$string = str_replace(
|
||||
return str_replace(
|
||||
array('Y','m','d','H','h','i','s','a','M', 'F'),
|
||||
array($year,$month,$day,$hour,$hour/12,$min,$sec,($hour <= 12) ? 'am' : 'pm',getMonthName($month), getMonthName($month,false)),
|
||||
$format
|
||||
);
|
||||
} else {
|
||||
// 1970년 이후라면 ztime()함수로 unixtime을 구하고 date함수로 처리
|
||||
$string = date($format, ztime($str));
|
||||
}
|
||||
|
||||
// 요일, am/pm을 각 언어에 맞게 변경
|
||||
$unit_week = Context::getLang('unit_week');
|
||||
$unit_meridiem = Context::getLang('unit_meridiem');
|
||||
$string = str_replace(array('Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday'),$unit_week, $string);
|
||||
$string = str_replace(array('am','pm','AM','PM'), $unit_meridiem, $string);
|
||||
return $string;
|
||||
// 1970년 이후라면 ztime()함수로 unixtime을 구하고 date함수로 처리
|
||||
return date($format, ztime($str));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue