2012-11-08 5 views

답변

2

이 조각이해야을 나타내는 반환 문제를 해결하는 데 도움이됩니다. 기존 날짜에서 불과 1 년 및 1 년 만 걸리고 다시 타임 스탬프로 변환하십시오.

<?php 
    $time = 1352376093; 
    $date = date('Y-m-01 00:00:00', $time); 
    $result = strtotime($date); 
0

그래서이 기능을 결국 : $earliest_issue가 시작 날짜입니다

$earliest_issue = db_result($result, 0); 
$day_of_month_of_earliest_issue = date("d", $earliest_issue); 
$hour_of_month_of_earliest_issue = date("h", $earliest_issue); 
$minute_of_month_of_earliest_issue = date("i", $earliest_issue); 
$seconds_in_month = date("s", $earliest_issue); 
$seconds_in_day_of_month = (($day_of_month_of_earliest_issue*24*60*60)-86400); 
$seconds_in_hour_of_month = (($hour_of_month_of_earliest_issue*60*60)-3600); 
$seconds_in_minute_of_month = (($minute_of_month_of_earliest_issue*60)); 
$start_time_of_query = ($earliest_issue - $seconds_in_day_of_month - $seconds_in_hour_of_month - $seconds_in_minute_of_month - $seconds_in_month); 

return $start_time_of_query; 

...

만약 사람이 내가 기여하시기 바랍니다 후 기대했던대로 더 우아한 기능을 가지고 읽기 , 감사!

관련 문제