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

                          主站蜘蛛池模板: 怡红院成人在线视频 | 精品国产视频 | 麻豆久久 | 国产成人精品午夜 | 日本一区二区三区在线观看 | 97人人澡人人爽91综合色 | 欧美久久国产 | 久久激情视频 | 三级成人片 | 蜜桃视频一区二区三区 | 国产91在线精品 | 国产成人综合在线 | 99国产精品99久久久久久粉嫩 | 精品国产亚洲一区二区三区大结局 | 精品一区二区视频 | 日韩精品在线看 | 91麻豆产精品久久久久久 | 99久久精品免费看国产四区 | 中文字幕在线电影观看 | 99热99| 视频一区二区中文字幕 | 久久久久免费精品国产 | 一级特黄网站 | 国内在线视频 | 国产精品久久久久久久7电影 | 日韩免费视频 | 成人不卡 | 中国一级特黄毛片大片 | 欧美久久一区二区 | 综合国产在线 | 请别相信他免费喜剧电影在线观看 | 黄色av免费网站 | 亚洲视频二区 | 欧美色影院| 亚洲欧美综合精品另类天天更新 | 99热热99 | 欧美精品片| 欧美激情精品久久久久久 | 免费性视频 | 337p日本欧洲亚洲大胆鲁鲁 | 日本高清视频网站 |