strtotime

    0熱度

    2回答

    試試這個代碼: <?php echo date('Y-m-d H:m:s', strtotime('today')); 我的期望是: 2014-10-08 00:00:00 但結果是: 2014-10-08 00:10:00 爲什麼和如何獲得期待呢?

    0熱度

    1回答

    我有一個應用程序,用戶輸入時間/日期,然後通過strtotime()轉換成Unix時間戳(用戶設置自己的時區)。這通常工作得很好; strtotime甚至設法將諸如2014年3月9日2:15 AM之類的時間轉換爲時間戳(其對應於如果用戶輸入「2014年3月9日上午3:15」將返回的時間戳)。 但是,例如,用戶想要輸入2014年11月2日上午的時間 - 具體地說,在2點到3點之間。是否有一個元素,用

    0熱度

    1回答

    下面給我October echo date('F'); 我用下面的代碼給我未來一個月的名稱(這一個月後一個),所以我希望能看到November。 $nextmonth = date("F",strtotime("+1 months")); 今天是10月31日,但上面給出'十二月'我做錯了什麼?我怎樣才能得到本月之後的月份?

    -1熱度

    3回答

    $date = '11/14/1997'; $unix_birthday = strtotime($date); echo $unix_birthday; 結果是:879487200 當我運行這段代碼: $time = 879487200; echo htmlspecialchars(gmdate("Y/m/d", $time)); 結果是:1997年11月14日 我該如何解決這個問

    0熱度

    1回答

    當我var_dump一個特定的變量,我得到: 'date' => int 1410307200 當我var_dumpdate('F j Y', strtotime($start_date)),我得到: string 'January 1 1970' (length=14) 我得到的結果相同,當我不要使用strtotime。 爲什麼它會一直回到紀元時間?

    0熱度

    1回答

    我正在嘗試檢索wordpress中最近8個月的帖子。我用下面的代碼來做到這一點 $args = array( 'posts_per_page' => -1, 'date_query' => array( array( 'column' => 'post_date_gmt', 'after' => '5 month ago',

    0熱度

    1回答

    這裏%OB是我的代碼: strftime('%OB %Y', time()); 此行返回false。我如何得到這個窗口的行? 謝謝!

    0熱度

    2回答

    我有一個的strtotime的問題,下面的代碼(我想所有日曆在給定的時間範圍weaks) $all_dates = array(); $tempdate = '2014-01-01'; $enddate = '2015-03-01'; while (strtotime($tempdate) <= strtotime($enddate)) { $all_dates[] = date

    0熱度

    2回答

    strtotime有點神奇。雖然我知道它不能做什麼,我總是在尋找正確的解決方案之前猜測事情。 所以我想得到下個月的第一個星期日和星期一。我嘗試這樣做: strtotime("first Sunday next month") strtotime("first Monday next month") 格式化(%d/%m/%y)之後的結果是: 12/11/2014 13/11/2014 這

    0熱度

    1回答

    您好我有一個從哪裏 `timestamp` >= '".$monS."' AND `timestamp` < '".$sunE."' 這裏是如何$monS和$sunE定義數據庫中選擇一個查詢: $startTime = "00:00:00"; $endTime = "23:59:59"; $today = date('l', strtotime("now")); if($today