久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

<tfoot id='fsGVX'></tfoot>

  1. <legend id='fsGVX'><style id='fsGVX'><dir id='fsGVX'><q id='fsGVX'></q></dir></style></legend>
    1. <small id='fsGVX'></small><noframes id='fsGVX'>

      • <bdo id='fsGVX'></bdo><ul id='fsGVX'></ul>

      <i id='fsGVX'><tr id='fsGVX'><dt id='fsGVX'><q id='fsGVX'><span id='fsGVX'><b id='fsGVX'><form id='fsGVX'><ins id='fsGVX'></ins><ul id='fsGVX'></ul><sub id='fsGVX'></sub></form><legend id='fsGVX'></legend><bdo id='fsGVX'><pre id='fsGVX'><center id='fsGVX'></center></pre></bdo></b><th id='fsGVX'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='fsGVX'><tfoot id='fsGVX'></tfoot><dl id='fsGVX'><fieldset id='fsGVX'></fieldset></dl></div>
    2. 致命錯誤:未捕獲的異常 'Exception' 帶有消息

      Fatal error: Uncaught exception #39;Exception#39; with message #39;DateTime::__construct(): Failed to parse time string(致命錯誤:未捕獲的異常 Exception 帶有消息 DateTime::__construct(): 無法解析時間字符串) - IT屋-程序
        <tbody id='mL41A'></tbody>
      • <bdo id='mL41A'></bdo><ul id='mL41A'></ul>

        <small id='mL41A'></small><noframes id='mL41A'>

        <tfoot id='mL41A'></tfoot>

        <legend id='mL41A'><style id='mL41A'><dir id='mL41A'><q id='mL41A'></q></dir></style></legend>

          • <i id='mL41A'><tr id='mL41A'><dt id='mL41A'><q id='mL41A'><span id='mL41A'><b id='mL41A'><form id='mL41A'><ins id='mL41A'></ins><ul id='mL41A'></ul><sub id='mL41A'></sub></form><legend id='mL41A'></legend><bdo id='mL41A'><pre id='mL41A'><center id='mL41A'></center></pre></bdo></b><th id='mL41A'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='mL41A'><tfoot id='mL41A'></tfoot><dl id='mL41A'><fieldset id='mL41A'></fieldset></dl></div>
              • 本文介紹了致命錯誤:未捕獲的異常 'Exception' 帶有消息 'DateTime::__construct(): 無法解析時間字符串的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                我收到這個錯誤

                ( ! ) 致命錯誤:未捕獲的異常 'Exception' 帶有消息 'DateTime::__construct(): 無法解析位置 0 (0) 處的時間字符串 (06-28-2014 07:43:58):意外字符' 在/Users/matt/Desktop/Likes/forgot/activate.php 第 17 行

                ( ! ) Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (06-28-2014 07:43:58 ) at position 0 (0): Unexpected character' in /Users/matt/Desktop/Likes/forgot/activate.php on line 17

                嘗試這樣做時

                //DB query
                $stmt = $con->prepare("SELECT token_created_at from reset WHERE token = :urltoken");
                $stmt->bindValue(':urltoken', $_GET['token']);
                $stmt->execute();
                $stmt->setFetchMode(PDO::FETCH_ASSOC);
                while($row = $stmt->fetch()) {
                     $token_created_at = $row['token_created_at'];
                }
                
                //Remove after testing
                echo $token_created_at;
                
                $my_dt = new DateTime($token_created_at);
                
                //Modify error
                $expires_at = $my_dt->modify('+1 hour');
                
                //Return current time to match
                $current_time = date('m-d-Y H:i:s ', time());
                

                第 17 行是 $my_dt = new DateTime($token_created_at); 這是我的時間格式 06-28-2014 07:43:58.

                Line 17 is $my_dt = new DateTime($token_created_at); and this is my time format 06-28-2014 07:43:58.

                這就是我生成token_created_at的方式,$time_gen = date('m-d-Y H:i:s ', time());.

                This is how I generate token_created_at, $time_gen = date('m-d-Y H:i:s ', time());.

                推薦答案

                您傳遞的日期字符串是 不支持 DateTime 解析器.您必須使用 createFromFormat 創建一個 DateTime 對象.此方法允許您在創建新的 DateTime 對象時指定自定義格式:

                The date string you're passing is not supported by the DateTime parser. You must create a DateTime object by using createFromFormat. This method allows you to specify the custom format when creating a new DateTime object:

                $my_dt = DateTime::createFromFormat('m-d-Y H:i:s', $token_created_at);
                

                如果您仍然收到錯誤,這意味著您的 $token_created_at 不是您指定的格式:

                If you're still getting an error that means that your $token_created_at is not in the format you specified:

                $now = date('m-d-Y H:i:s'); //string(19) "06-28-2014 15:00:47"
                
                var_dump(DateTime::createFromFormat('m-d-Y H:i:s', $now));
                object(DateTime)#1 (3) {
                  ["date"]=>
                  string(19) "2014-06-28 15:00:47"
                  ["timezone_type"]=>
                  int(3)
                  ["timezone"]=>
                  string(13) "Europe/Berlin"
                }
                

                編輯

                我看到您的問題 - 格式字符串在 s 之后有一個空格.格式字符串必須完全匹配:

                I see your problem - the format string has a space after s. The format strings must match exactly:

                $my_dt = DateTime::createFromFormat('m-d-Y H:i:s ', $token_created_at);
                

                這篇關于致命錯誤:未捕獲的異常 'Exception' 帶有消息 'DateTime::__construct(): 無法解析時間字符串的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                相關文檔推薦

                Deadlock exception code for PHP, MySQL PDOException?(PHP、MySQL PDOException 的死鎖異常代碼?)
                PHP PDO MySQL scrollable cursor doesn#39;t work(PHP PDO MySQL 可滾動游標不起作用)
                PHP PDO ODBC connection(PHP PDO ODBC 連接)
                Using PDO::FETCH_CLASS with Magic Methods(使用 PDO::FETCH_CLASS 和魔術方法)
                php pdo get only one value from mysql; value that equals to variable(php pdo 只從 mysql 獲取一個值;等于變量的值)
                MSSQL PDO could not find driver(MSSQL PDO 找不到驅動程序)
                <i id='wLIAt'><tr id='wLIAt'><dt id='wLIAt'><q id='wLIAt'><span id='wLIAt'><b id='wLIAt'><form id='wLIAt'><ins id='wLIAt'></ins><ul id='wLIAt'></ul><sub id='wLIAt'></sub></form><legend id='wLIAt'></legend><bdo id='wLIAt'><pre id='wLIAt'><center id='wLIAt'></center></pre></bdo></b><th id='wLIAt'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='wLIAt'><tfoot id='wLIAt'></tfoot><dl id='wLIAt'><fieldset id='wLIAt'></fieldset></dl></div>

                    <small id='wLIAt'></small><noframes id='wLIAt'>

                      <tbody id='wLIAt'></tbody>
                    <legend id='wLIAt'><style id='wLIAt'><dir id='wLIAt'><q id='wLIAt'></q></dir></style></legend>

                      <tfoot id='wLIAt'></tfoot>
                        • <bdo id='wLIAt'></bdo><ul id='wLIAt'></ul>
                          主站蜘蛛池模板: 午夜视频一区二区 | 天堂在线免费视频 | 午夜精品久久久久久久星辰影院 | 理论片午午伦夜理片影院 | 欧美视频中文字幕 | 精品真实国产乱文在线 | 草草草久久久 | 观看av | 麻豆视频在线看 | 成人精品毛片国产亚洲av十九禁 | 欧美精品一区二区三 | 精品一区二区三区在线观看国产 | 成人免费在线播放 | 中文字幕第三页 | 欧美精品91爱爱 | 国产精品一区久久久久 | 欧美精品成人 | 亚洲首页 | 岛国av一区二区 | 成人免费在线电影 | 国产精品久久国产精品 | 亚洲网站在线观看 | 精品日韩一区二区 | 欧美日韩亚洲一区 | 午夜精品影院 | 久久久久久影院 | 中文字幕在线一区二区三区 | 成人黄色在线 | 日韩欧美在线一区二区 | 日韩精品一区二区三区中文在线 | 成人一区二区在线 | 亚洲入口 | www.99精品| 国产精品欧美一区二区三区 | 久久久久久亚洲精品 | 国产中文视频 | 中文字幕av网| 欧美一级精品片在线看 | 久久久久久久av麻豆果冻 | 亚洲午夜精品 | 国产精品一区在线观看你懂的 |