久久久久久久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'>

                          主站蜘蛛池模板: 国产亚洲精品久久久优势 | 伊人伊人 | 免费成人高清 | www.日韩av.com | 日韩欧美专区 | 91在线观看| 欧美精品一区二区在线观看 | 日韩无 | 在线看av的网址 | 一区二区三区精品视频 | 人人叉 | 久久青青| 国产精品一区二区三区久久 | 亚洲欧美日韩中文字幕一区二区三区 | 不卡一区二区在线观看 | 亚洲高清在线 | www.中文字幕.com | 五月婷婷激情网 | 极情综合网 | 91毛片在线看 | 欧美精品中文字幕久久二区 | 日韩精品一区二区三区高清免费 | 国户精品久久久久久久久久久不卡 | 免费一区二区 | 18成人在线观看 | 日韩久久久久 | 欧美在线视频一区二区 | 天天弄| 亚洲三区在线播放 | 羞羞视频免费在线观看 | 9191av| 亚洲一区二区三区免费视频 | 久久免费视频网 | 亚洲欧洲成人av每日更新 | 国产精品综合网 | 九九久久久久久 | 国产精品一区二区电影 | 成人在线欧美 | 日韩精品专区在线影院重磅 | 黄免费看| 亚洲成人免费视频 |