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

    <bdo id='KSoGp'></bdo><ul id='KSoGp'></ul>

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

    1. <tfoot id='KSoGp'></tfoot>

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

      <i id='KSoGp'><tr id='KSoGp'><dt id='KSoGp'><q id='KSoGp'><span id='KSoGp'><b id='KSoGp'><form id='KSoGp'><ins id='KSoGp'></ins><ul id='KSoGp'></ul><sub id='KSoGp'></sub></form><legend id='KSoGp'></legend><bdo id='KSoGp'><pre id='KSoGp'><center id='KSoGp'></center></pre></bdo></b><th id='KSoGp'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='KSoGp'><tfoot id='KSoGp'></tfoot><dl id='KSoGp'><fieldset id='KSoGp'></fieldset></dl></div>

      無法格式化默認的 MySQL 日期時間

      Unable to format default MySQL datetime(無法格式化默認的 MySQL 日期時間)
        <tbody id='11jtC'></tbody>
        <tfoot id='11jtC'></tfoot>

          <bdo id='11jtC'></bdo><ul id='11jtC'></ul>

            <small id='11jtC'></small><noframes id='11jtC'>

              <legend id='11jtC'><style id='11jtC'><dir id='11jtC'><q id='11jtC'></q></dir></style></legend>

                <i id='11jtC'><tr id='11jtC'><dt id='11jtC'><q id='11jtC'><span id='11jtC'><b id='11jtC'><form id='11jtC'><ins id='11jtC'></ins><ul id='11jtC'></ul><sub id='11jtC'></sub></form><legend id='11jtC'></legend><bdo id='11jtC'><pre id='11jtC'><center id='11jtC'></center></pre></bdo></b><th id='11jtC'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='11jtC'><tfoot id='11jtC'></tfoot><dl id='11jtC'><fieldset id='11jtC'></fieldset></dl></div>
                本文介紹了無法格式化默認的 MySQL 日期時間的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                限時送ChatGPT賬號..

                我的日期從數據庫中出來是這樣的:2013-11-21 17:43:20

                我正在嘗試使用 Angular 的日期過濾器將它們變成更漂亮的東西,但是...

                {{Objected.created |日期:'shortDate'}}

                {{Objected.created |日期:'YYYY'}}

                ...只是吐出原始日期時間字符串:2013-11-21 17:43:20.沒有錯誤.我做錯了什么?

                更新我看到 MySQL 的默認日期時間與 Angular 的數據過濾器所期望的不兼容.我正在嘗試像這樣即時轉換它,但它拋出錯誤:

              1. {{ new Date(result.Job.created).toISOString() |日期:'shortDate'}}
              2. 我懷疑我無法以我嘗試的方式實例化 Date 類.錯誤是 $parse:syntax 錯誤.

                更新

                感謝@m59 的幫助,我通過一些小的調整讓它工作......

                HTML:

                ...{{Object.created |dateToISO |日期:'shortDate'}}

                JS:

                var myApp = angular.module('myApp',[]);myApp.filter('dateToISO', function() {返回函數(輸入){input = new Date(input).toISOString();返回輸入;};});

                這個自定義過濾器將默認的 MySQL 日期時間轉換為日期過濾器期望的格式,所以我發送它一個又一個然后瞧".

                解決方案

                您需要將日期字符串轉換為 Angular 支持的格式,例如 ISO 8601 格式.你可以這樣轉換:

                $scope.Object.created = new Date($scope.Object.created).toISOString();

                此處進行現場演示(點擊).

                要即時執行此操作,您需要一個自定義過濾器.現場演示(點擊).

                標記:

                {{Object.created |dateToISO |日期:'shortDate'}}

                JavaScript:

                app.filter('dateToISO', function() {返回函數(輸入){返回新日期(輸入).toISOString();};});

                更新:

                這是一種手動轉換日期的簡單方法 (firefox):

                app.filter('badDateToISO', function() {返回函數(壞時間){var goodTime = badTime.replace(/(.+) (.+)/, "$1T$2Z");回歸美好時光;};});

                My dates come out of the database looking like this: 2013-11-21 17:43:20

                I'm trying to user Angular's date filter to turn them into something prettier, but...

                {{Objected.created | date:'shortDate'}}
                

                or

                {{Objected.created | date:'YYYY'}}
                

                ...just spits out the original datetime string: 2013-11-21 17:43:20. There are no errors. What am I doing wrong?

                Update I see that MySQL's default datetime is incompatible with what Angular's data filter expects. I'm attempting to convert it on the fly like this but it's throwing errors:

                <li ng-repeat="result in data">{{ new Date(result.Job.created).toISOString() | date:'shortDate'}}</li>
                

                I suspect I can't instantiate the Date class in the way I'm trying. The error is a $parse:syntax error.

                Update

                Thanks to @m59's help, I got it working with a few minor adjustments...

                HTML:

                <html ng-app="myApp">
                ...
                {{Object.created | dateToISO | date:'shortDate'}}
                

                JS:

                var myApp = angular.module('myApp',[]);
                
                myApp.filter('dateToISO', function() {
                  return function(input) {
                    input = new Date(input).toISOString();
                    return input;
                  };
                });
                

                This custom filter converts the default MySQL datetime into the format that the date filter expects, so I send it throw one then another and "voila".

                解決方案

                You need to convert your date string to something supported by Angular, like ISO 8601 format. You could convert it like this:

                $scope.Object.created = new Date($scope.Object.created).toISOString();
                

                Live demo here (click).

                To do this on the fly, you need a custom filter. Live demo here (click).

                Markup:

                <div>{{Object.created | dateToISO | date:'shortDate'}}</div>
                

                JavaScript:

                app.filter('dateToISO', function() {
                  return function(input) {
                    return new Date(input).toISOString();
                  };
                });
                

                Update:

                Here's a simple way to convert your date manually (firefox):

                app.filter('badDateToISO', function() {
                  return function(badTime) {
                    var goodTime = badTime.replace(/(.+) (.+)/, "$1T$2Z");
                    return goodTime;
                  };
                });
                

                這篇關于無法格式化默認的 MySQL 日期時間的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                相關文檔推薦

                SQL query to get all products, categories and meta data woocommerce/wordpress(獲取所有產品、類別和元數據的 SQL 查詢 woocommerce/wordpress)
                How to use MySQL in WSL (Windows Subsystem for Linux)?(如何在 WSL(Linux 的 Windows 子系統)中使用 MySQL?)
                PowerShell MySQL Backup Script Error in Task Scheduler 0x00041301(任務計劃程序中的 PowerShell MySQL 備份腳本錯誤 0x00041301)
                Import the data from the XML files into a MySQL database(將數據從 XML 文件導入 MySQL 數據庫)
                installed Xampp on Windows 7 32-bit. Errors when starting(在 Windows 7 32 位上安裝 Xampp.啟動時的錯誤)
                Mysql lower case table on Windows xampp(Windows xampp 上的 Mysql 小寫表)

                    <bdo id='AI2PN'></bdo><ul id='AI2PN'></ul>
                  • <i id='AI2PN'><tr id='AI2PN'><dt id='AI2PN'><q id='AI2PN'><span id='AI2PN'><b id='AI2PN'><form id='AI2PN'><ins id='AI2PN'></ins><ul id='AI2PN'></ul><sub id='AI2PN'></sub></form><legend id='AI2PN'></legend><bdo id='AI2PN'><pre id='AI2PN'><center id='AI2PN'></center></pre></bdo></b><th id='AI2PN'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='AI2PN'><tfoot id='AI2PN'></tfoot><dl id='AI2PN'><fieldset id='AI2PN'></fieldset></dl></div>
                  • <tfoot id='AI2PN'></tfoot>
                    <legend id='AI2PN'><style id='AI2PN'><dir id='AI2PN'><q id='AI2PN'></q></dir></style></legend>
                      <tbody id='AI2PN'></tbody>

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

                          主站蜘蛛池模板: 精品国产乱码久久久久久88av | 婷婷五月在线视频 | 99国产精品99久久久久久粉嫩 | 香蕉伊人网 | 黄色小视频在线播放 | 五月色丁香 | 色偷偷网站| 在线免费观看日韩av | 日本黄网站| 精品国产区一区二 | 国产一区久久 | 五月婷婷丁香 | 色婷婷综合在线 | 三级网站在线 | www.亚洲天堂| 亚洲天堂日本 | 91精品国产色综合久久不卡98 | 在线观看小视频 | 丁香激情五月 | 久久xx | 日韩欧美一区二区三区 | 欧美黄色片视频 | 在线播放国产精品 | 99精品久久久久久中文字幕 | 欧美日韩国 | 91最新视频 | 久久久国产视频 | 97精品视频在线观看 | h片在线观看免费 | 中文字幕系列 | 成人国产 | 精品国产乱码久久久久久88av | 黄色午夜 | 欧美色影院 | 婷婷狠狠 | 成人在线免费观看网站 | 国产一区二区三区四区 | 91蝌蚪少妇偷拍 | 男女瑟瑟视频 | 欧美激情区 | 小sao货撅起屁股扒开c微博 |