시간대 기능 제작에 대한 노트 정보
기타 시간대 기능 제작에 대한 노트본문
개인적인(?) 이유로 적어놓습니다. 혹시 이런 허접한 노트를 읽고서라도 도움이 될만한 내용이 있다면 알려주시면 고맙겠습니다.
* gb_member table 에 새로운 영역 추가 (mb_timezone) ; int(2), not null, 기본값 9 (한국)
* config.inc.php 맨 아래에 다음 내용 추가
$cfg[server_timezone] = -6; // 서버의 시간대 (GMT)
* now() 함수 대체 - lib.inc.php에 정의해준다.
gbupdate.php
mbupdate.php
lib.inc.php
mblogincheck.php
mbmemoupdate.php
mbmemoview.php
** 시간대계산함수 (나중에 함수손봐야함)
///시간대 계산
$time_server = -6; //캐나다
$time_local = +9; //한국
if ($time_server = $time_local) $time_offset = 0; // 시간대가 같다면 타임존 옵션 필요없음
elseif ($time_server > $time_local) { // 서버시간이 지역시간보다 빠를 경우
$time_offset = $time_server - $time_local;
if ($time_server < 0) $time_offset = -($time_offset); //서버시간이 0보다 작다면 서버시간에서 지역시간을 뺀 시간이 음수이므로
}
else { // 서버시간이 지역시간보다 느릴 경우
$time_offset = $time_local - $time_server;
if ($time_local < 0) $time_offset = -($time_offset); //지역시간이 0보다 작다면 지역시간에서 서버시간을 뺀 시간이 음수이므로
}
* gb_member table 에 새로운 영역 추가 (mb_timezone) ; int(2), not null, 기본값 9 (한국)
* config.inc.php 맨 아래에 다음 내용 추가
$cfg[server_timezone] = -6; // 서버의 시간대 (GMT)
* now() 함수 대체 - lib.inc.php에 정의해준다.
gbupdate.php
mbupdate.php
lib.inc.php
mblogincheck.php
mbmemoupdate.php
mbmemoview.php
** 시간대계산함수 (나중에 함수손봐야함)
///시간대 계산
$time_server = -6; //캐나다
$time_local = +9; //한국
if ($time_server = $time_local) $time_offset = 0; // 시간대가 같다면 타임존 옵션 필요없음
elseif ($time_server > $time_local) { // 서버시간이 지역시간보다 빠를 경우
$time_offset = $time_server - $time_local;
if ($time_server < 0) $time_offset = -($time_offset); //서버시간이 0보다 작다면 서버시간에서 지역시간을 뺀 시간이 음수이므로
}
else { // 서버시간이 지역시간보다 느릴 경우
$time_offset = $time_local - $time_server;
if ($time_local < 0) $time_offset = -($time_offset); //지역시간이 0보다 작다면 지역시간에서 서버시간을 뺀 시간이 음수이므로
}
추천
0
0
댓글 15개
홧팅.. 포인트용용.... ㅠㅠ
모두 행복하세요^^
이게 므양?
오우~ 멋져부러.
ㅇ
포인트용입니다//양해바랍니다^^ㅋㅋㅋㅌㅋㅌㅊ
ㅋㅋ
열심.. 나두 영카트 살라고 하려니 포인트가.
열심히 해야죠.
ㅂㅂ
ㅎㅎㅎ
ㅎㅎㅎ
스웨디시 찾을 때는 언제나 뭉치고 https://moongchigo.com/
신고가 접수된 글입니다.
신고 횟수가 1회 이상이면 글을 확인하지 못합니다.
솔루션에관한 내용은 없나요?