ClassyCountdown 한국시간 적용방법

ClassyCountdown 한국시간 적용방법

QA

ClassyCountdown 한국시간 적용방법

본문

3731648085_1682559401.2346.jpg

jQuery Classy Countdown Plugin Demos (jqueryscript.net)에서 카운트 다운을 다운받아 그누보드에 설치해 봤습니다. 그런데 9시간 느리게 카운드 다운이 되네요. 한국시간으로 UTC+9 하여 카운트 되도록 하는 방법을 도저히 모르겠네요. 

저는 다음과 같이 작성해봤습니다. 


<script type="text/javascript">
$(document).ready(function() {
  $('#countdown17').ClassyCountdown({
    theme: "flat-colors-very-wide",
    now: Math.round(new Date().getTime() / 1000),
    end: Math.round(new Date('<?php            
            echo $list[$i]['datetime2'] = date("Y", strtotime($list[$i]['wr_datetime']));
             ?>-<?php            
            echo $list[$i]['datetime2'] = date("m", strtotime($list[$i]['wr_datetime']));
             ?>-<?php            
            echo $list[$i]['datetime2'] = date("d", strtotime($list[$i]['wr_datetime']));
             ?>T<?php            
            echo $list[$i]['datetime2'] = date("H", strtotime($list[$i]['wr_datetime']));
             ?>:<?php            
            echo $list[$i]['datetime2'] = date("i", strtotime($list[$i]['wr_datetime']));
             ?>Z').getTime() / 1000),
    onEndCallback: function() {},
    events: {
      onTick: function(event) {
        var $this = $(this).find('.ClassyCountdown-seconds');
        if (event.offset.seconds <= 5) {
          $this.addClass('flash');
        } else {
          $this.removeClass('flash');
        }
      }
    },
    timezone: "Asia/Seoul" // 한국 시간으로 설정합니다.
  });
});
</script>

이 질문에 댓글 쓰기 :

답변 2

챗 GPT가 해결해 주었습니다. 

 

<script type="text/javascript">
$(document).ready(function() {
  $('#countdown17').ClassyCountdown({
    theme: "flat-colors-very-wide",
    now: $.now() / 1000, // 현재 시간
    end: new Date("<?php            
            echo $list[$i]['datetime2'] = date("Y", strtotime($list[$i]['wr_datetime']));
             ?>/<?php            
            echo $list[$i]['datetime2'] = date("m", strtotime($list[$i]['wr_datetime']));
             ?>/<?php            
            echo $list[$i]['datetime2'] = date("d", strtotime($list[$i]['wr_datetime']));
             ?> <?php            
            echo $list[$i]['datetime2'] = date("H", strtotime($list[$i]['wr_datetime']));
             ?>:<?php            
            echo $list[$i]['datetime2'] = date("i", strtotime($list[$i]['wr_datetime']));
             ?>:00").getTime() / 1000, // 종료 시간
    onEndCallback: function() {
      alert("카운트다운이 종료되었습니다!");
    }
  });
});
</script>

답변을 작성하시기 전에 로그인 해주세요.
전체 0 | RSS
QA 내용 검색
  • 개별 목록 구성 제목 답변작성자조회작성일
  • 질문이 없습니다.

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT