mysql TO_DAYS(date) 函数
- font size decrease font size increase font size
- Print Email
TO_DAYS(date)
给定一个日期date, 返回一个天数 (从年份0开始的天数 )。
mysql> SELECT TO_DAYS(950501);
-> 728779
mysql> SELECT TO_DAYS(‘1997-10-07′);
-> 729669
TO_DAYS() 不用于阳历出现(1582)前的值,原因是当日历改变时,遗失的日期不会被考虑在内。
请记住, MySQL“日期和时间类型”中的规则将日期中的二位数年份值转化为四位。例如, ‘1997-10-07′和 ‘97-10-07′ 被视为同样的日期:
mysql> SELECT TO_DAYS(‘1997-10-07′), TO_DAYS(‘97-10-07′);
-> 729669, 729669
对于1582 年之前的日期(或许在其它地区为下一年 ), 该函数的结果实不可靠的。
Last modified onSunday, 14 October 2012 04:07
( ! ) Warning: count(): Parameter must be an array or an object that implements Countable in /var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php on line 169 | ||||
---|---|---|---|---|
Call Stack | ||||
# | Time | Memory | Function | Location |
1 | 0.0006 | 412320 | {main}( ) | .../index.php:0 |
2 | 0.0814 | 4262288 | Joomla\CMS\Application\SiteApplication->execute( ) | .../index.php:49 |
3 | 0.0814 | 4262288 | Joomla\CMS\Application\SiteApplication->doExecute( ) | .../CMSApplication.php:196 |
4 | 0.2740 | 11453280 | Joomla\CMS\Application\SiteApplication->dispatch( ) | .../SiteApplication.php:233 |
5 | 0.2747 | 11477608 | Joomla\CMS\Component\ComponentHelper::renderComponent( ) | .../SiteApplication.php:194 |
6 | 0.2754 | 11532936 | Joomla\CMS\Component\ComponentHelper::executeComponent( ) | .../ComponentHelper.php:377 |
7 | 0.2757 | 11560336 | require_once( '/var/www/vhosts/shan.info/httpdocs/components/com_k2/k2.php' ) | .../ComponentHelper.php:402 |
8 | 0.2837 | 11959968 | K2ControllerItem->execute( ) | .../k2.php:64 |
9 | 0.2837 | 11959968 | K2ControllerItem->display( ) | .../BaseController.php:710 |
10 | 0.2937 | 12610672 | K2ControllerItem->display( ) | .../item.php:78 |
11 | 0.2937 | 12610672 | K2ControllerItem->display( ) | .../controller.php:19 |
12 | 0.2979 | 12981712 | Joomla\CMS\Cache\Controller\ViewController->get( ) | .../BaseController.php:663 |
13 | 0.2988 | 13002080 | K2ViewItem->display( ) | .../ViewController.php:102 |
14 | 0.3574 | 15771480 | K2ViewItem->display( ) | .../view.html.php:742 |
15 | 0.3574 | 15771480 | K2ViewItem->loadTemplate( ) | .../HtmlView.php:230 |
16 | 0.3589 | 15944416 | include( '/var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php' ) | .../HtmlView.php:701 |
- Published in MYSQL
- Read 4092 times
( ! ) Notice: Only variables should be assigned by reference in /var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php on line 478 | ||||
---|---|---|---|---|
Call Stack | ||||
# | Time | Memory | Function | Location |
1 | 0.0006 | 412320 | {main}( ) | .../index.php:0 |
2 | 0.0814 | 4262288 | Joomla\CMS\Application\SiteApplication->execute( ) | .../index.php:49 |
3 | 0.0814 | 4262288 | Joomla\CMS\Application\SiteApplication->doExecute( ) | .../CMSApplication.php:196 |
4 | 0.2740 | 11453280 | Joomla\CMS\Application\SiteApplication->dispatch( ) | .../SiteApplication.php:233 |
5 | 0.2747 | 11477608 | Joomla\CMS\Component\ComponentHelper::renderComponent( ) | .../SiteApplication.php:194 |
6 | 0.2754 | 11532936 | Joomla\CMS\Component\ComponentHelper::executeComponent( ) | .../ComponentHelper.php:377 |
7 | 0.2757 | 11560336 | require_once( '/var/www/vhosts/shan.info/httpdocs/components/com_k2/k2.php' ) | .../ComponentHelper.php:402 |
8 | 0.2837 | 11959968 | K2ControllerItem->execute( ) | .../k2.php:64 |
9 | 0.2837 | 11959968 | K2ControllerItem->display( ) | .../BaseController.php:710 |
10 | 0.2937 | 12610672 | K2ControllerItem->display( ) | .../item.php:78 |
11 | 0.2937 | 12610672 | K2ControllerItem->display( ) | .../controller.php:19 |
12 | 0.2979 | 12981712 | Joomla\CMS\Cache\Controller\ViewController->get( ) | .../BaseController.php:663 |
13 | 0.2988 | 13002080 | K2ViewItem->display( ) | .../ViewController.php:102 |
14 | 0.3574 | 15771480 | K2ViewItem->display( ) | .../view.html.php:742 |
15 | 0.3574 | 15771480 | K2ViewItem->loadTemplate( ) | .../HtmlView.php:230 |
16 | 0.3589 | 15944416 | include( '/var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php' ) | .../HtmlView.php:701 |