ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • 날짜
    PHP 2020. 5. 6. 18:50
    $last = date("t", strtotime($year."-".$month."-01 00:00:00")); //해당달의 마지막 날짜한달전
    $start = date("Y-m-01", strtotime("-1 month", time()));
    $end = date("Y-m-".date("t", strtotime($start)), strtotime("-1 month", time()));
    
    //시작일~~종료일 출력
    $start =  strtotime($sc["sc_date_start"]);
    $end = strtotime($sc["sc_date_end"]);
    while ($start <= $end)
    {      
    	echo date('Y-m-d-D', $start);    
        echo '<br>';       
        $start = strtotime("+1 day",$start);
     }
     
     //옵션 30분단위로 출력
     $store = sql_fetch(" SELECT * FROM g5_store WHERE st_id = '{$_POST["stId"]}' ");
     $start = $store["st_start_time"].":00";
     $end = $store["st_end_time"].":00";
     $tStart = strtotime($start);
     $tEnd = strtotime($end);
     $tNow = $tStart;
     $skipTime = strtotime('+1 hours', time());
    <?php while($tNow <= $tEnd) : ?>
    <?php if($_POST["picDate"] == date("Y-m-d")) : ?>
    <?php    
    if($skipTime > $tNow)
    {        
    $tNow = strtotime('+30 minutes',$tNow);
    continue; 
    }
    ?>
    <?php endif; ?>
    <option value="<?= date("H:i",$tNow) ?>"><?= date("H:i",$tNow) ?></option>
    <?php
    $tNow = strtotime('+30 minutes',$tNow);
    endwhile; 
    ?>
    <?php if(!$store) : ?>
    <option value="">시간선택</option>
    <?php endif;?>
    
    

    'PHP' 카테고리의 다른 글

    file php 소스코드형식으로 저장하기  (0) 2020.05.15
    이름 마스킹 처리(맨앞과 뒤만 출력)  (0) 2020.05.06
    핸드폰 구분자 넣기  (0) 2020.05.06
    php 문법 스트링 변수 만들기  (0) 2020.05.06
    날짜계산 함수  (0) 2020.05.06

    댓글

Designed by Tistory.