久久久久久久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>
                          主站蜘蛛池模板: 欧美韩一区二区 | 亚洲二区在线 | 视频第一区 | 男人的天堂avav | 国产精品久久久久一区二区三区 | 国产黄色av网站 | 亚洲一区二区三区在线视频 | 蜜桃一区二区三区在线 | 欧美日高清视频 | 日本又色又爽又黄的大片 | 欧亚av在线| 一区二区三区av | 国产高清在线 | 国产精品国产馆在线真实露脸 | 国产伦精品一区二区三毛 | 色黄网站| av免费入口 | 黄色片网站在线观看 | 国产香蕉视频在线播放 | 欧美成视频在线观看 | 99草免费视频 | 青青草一区| 2020亚洲天堂 | 亚洲国产欧美一区二区三区久久 | 成人在线中文 | 免费一看一级毛片 | 久久不卡 | 在线观看日韩 | 黄网站免费在线看 | 成年免费在线观看 | 亚洲精品成人网 | 国产人成在线观看 | 日韩成人在线免费观看 | 国产精品日韩欧美一区二区三区 | 日韩一区二区免费视频 | 亚洲一区二区三区免费观看 | 在线观看成人小视频 | 久久精品1 | 欧美日韩国产一区二区三区 | 久久丁香| 91视频在线网站 |