{"id":3105,"date":"2021-01-07T17:14:10","date_gmt":"2021-01-07T09:14:10","guid":{"rendered":"https:\/\/www.gbase8.cn\/?p=3105"},"modified":"2021-03-08T10:46:39","modified_gmt":"2021-03-08T02:46:39","slug":"gbase-8a%e8%8e%b7%e5%be%97%e5%bd%93%e5%89%8d%e6%97%a5%e6%9c%9f%e6%97%b6%e9%97%b4%e6%af%ab%e7%a7%92%e5%be%ae%e7%a7%92%e7%9a%84%e5%87%a0%e4%b8%aa%e5%87%bd%e6%95%b0%e4%bd%bf%e7%94%a8%e6%a0%b7%e4%be%8b","status":"publish","type":"post","link":"https:\/\/www.gbase8.cn\/en\/3105","title":{"rendered":"\u5357\u5927\u901a\u7528GBase 8a\u83b7\u5f97\u5f53\u524d\u65e5\u671f\u65f6\u95f4\u6beb\u79d2\u5fae\u79d2\u7684\u51e0\u4e2a\u51fd\u6570\u4f7f\u7528\u6837\u4f8b"},"content":{"rendered":"<p>\u672c\u6587\u4ecb\u7ecdGBase 8a\u6570\u636e\u5e93\u96c6\u7fa4\u91cc\uff0c\u83b7\u5f97\u5f53\u524d\u65e5\u671f\uff0c\u65f6\u95f4\uff0c\u6beb\u79d2\u5fae\u79d2\u7684\u51e0\u4e2a\u51fd\u6570\u7684\u4f7f\u7528\u65b9\u6cd5\u3002<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_84 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Directory Navigation<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6a2ade5a6e82e\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewbox=\"0 0 24 24\" version=\"1.2\" baseprofile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6a2ade5a6e82e\"  aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.gbase8.cn\/en\/3105\/#%E6%B1%87%E6%80%BB\" >\u6c47\u603b<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.gbase8.cn\/en\/3105\/#now\" >now<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.gbase8.cn\/en\/3105\/#current_date\" >current_date<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.gbase8.cn\/en\/3105\/#current_datetime\" >current_datetime<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.gbase8.cn\/en\/3105\/#current_timestamp\" >current_timestamp<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.gbase8.cn\/en\/3105\/#current_time\" >current_time<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.gbase8.cn\/en\/3105\/#MICROSECONDexpr\" >MICROSECOND(expr)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.gbase8.cn\/en\/3105\/#sysdate\" >sysdate<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.gbase8.cn\/en\/3105\/#utc_date\" >utc_date<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.gbase8.cn\/en\/3105\/#utc_datetime\" >utc_datetime<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/www.gbase8.cn\/en\/3105\/#utc_time\" >utc_time<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/www.gbase8.cn\/en\/3105\/#utc_timestamp\" >utc_timestamp<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/www.gbase8.cn\/en\/3105\/#%E5%8F%82%E8%80%83\" >\u53c2\u8003<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E6%B1%87%E6%80%BB\"><\/span>\u6c47\u603b<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u5176\u4e2dsysdate\u662f\u517c\u5bb9oracle\u7684\u5199\u6cd5\uff0c\u4f46\u9700\u8981\u6709\u51fd\u6570\u7684\u5c0f\u62ec\u53f7\u3002current_date,current_date()\u90fd\u53ef\u4ee5<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td>Function<\/td><td>\u5c0f\u62ec\u53f7<\/td><td>Date<\/td><td>\u65f6\u95f4<\/td><td>\u6beb\u79d2\u5fae\u79d2<\/td><\/tr><tr><td>now<\/td><td>\u5fc5\u987b<\/td><td>Y<\/td><td>Y<\/td><td><\/td><\/tr><tr><td>current_date<\/td><td><\/td><td>Y<\/td><td><\/td><td><\/td><\/tr><tr><td>current_datetime<\/td><td><\/td><td>Y<\/td><td>Y<\/td><td>Y<\/td><\/tr><tr><td>current_timestamp<\/td><td><\/td><td>Y<\/td><td>Y<\/td><td><\/td><\/tr><tr><td>current_time<\/td><td><\/td><td><\/td><td>Y<\/td><td><\/td><\/tr><tr><td>utc_date<\/td><td><\/td><td>Y<\/td><td><\/td><td><\/td><\/tr><tr><td>utc_datetime<\/td><td><\/td><td>Y<\/td><td>Y<\/td><td>Y<\/td><\/tr><tr><td>utc_timestamp<\/td><td><\/td><td>Y<\/td><td>Y<\/td><td><\/td><\/tr><tr><td>utc_time<\/td><td><\/td><td><\/td><td>Y<\/td><td><\/td><\/tr><tr><td>sysdate<\/td><td>\u5fc5\u987b<\/td><td>Y<\/td><td>Y<\/td><td><\/td><\/tr><tr><td>MICROSECOND<\/td><td>\u5fc5\u987b<\/td><td><\/td><td><\/td><td>Y<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"now\"><\/span>now<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u8fd4\u56de\u5f53\u524d\u65e5\u671f\u65f6\u95f4<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>gbase&gt; select now();\n+---------------------+\n| now()               |\n+---------------------+\n| 2021-01-07 17:05:27 |\n+---------------------+\n1 row in set (Elapsed: 00:00:00.00)\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"current_date\"><\/span>current_date<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u5f53\u524d\u65e5\u671f\uff0c\u4e0d\u5305\u542b\u65f6\u95f4\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>gbase&gt; select current_date;\n+--------------+\n| current_date |\n+--------------+\n| 2021-01-07   |\n+--------------+\n1 row in set (Elapsed: 00:00:00.01)\n\ngbase&gt; select current_date();\n+----------------+\n| current_date() |\n+----------------+\n| 2021-01-07     |\n+----------------+\n1 row in set (Elapsed: 00:00:00.00)\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"current_datetime\"><\/span>current_datetime<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u5f53\u524d\u65e5\u671f\u65f6\u95f4\uff0c\u5305\u542b\u6beb\u79d2\uff0c\u5fae\u79d2\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>gbase&gt; select current_datetime;\n+----------------------------+\n| current_datetime           |\n+----------------------------+\n| 2021-01-07 17:30:03.268713 |\n+----------------------------+\n1 row in set (Elapsed: 00:00:00.00)\n\ngbase&gt; select current_datetime();\n+----------------------------+\n| current_datetime()         |\n+----------------------------+\n| 2021-01-07 17:06:29.661921 |\n+----------------------------+\n1 row in set (Elapsed: 00:00:00.00)\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"current_timestamp\"><\/span>current_timestamp<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u5f53\u524d\u65f6\u95f4\u6233\uff0c\u65e5\u671f\u548c\u65f6\u95f4\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>gbase&gt; select current_timestamp;\n+---------------------+\n| current_timestamp   |\n+---------------------+\n| 2021-01-07 17:28:29 |\n+---------------------+\n1 row in set (Elapsed: 00:00:00.00)\n\ngbase&gt; select current_timestamp();\n+---------------------+\n| current_timestamp() |\n+---------------------+\n| 2021-01-07 17:08:58 |\n+---------------------+\n1 row in set (Elapsed: 00:00:00.00)\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"current_time\"><\/span>current_time<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u5f53\u524d\u65f6\u95f4\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>gbase> select current_time;\n+--------------+\n| current_time |\n+--------------+\n| 17:29:20     |\n+--------------+\n1 row in set (Elapsed: 00:00:00.00)\n\ngbase> select current_time();\n+----------------+\n| current_time() |\n+----------------+\n| 17:09:03       |\n+----------------+\n1 row in set (Elapsed: 00:00:00.00)<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"MICROSECONDexpr\"><\/span>MICROSECOND(expr)<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u4ee5\u6570\u5b57\u7684\u5f62\u5f0f\u8fd4\u56de time \u6216\u8005 datetime \u8868\u8fbe\u5f0f expr \u4e2d\u7684\u5fae\u79d2\u503c\uff0c\u6570\u5b57\u53d6\u503c\u8303\u56f4\u662f 0\u5230 999999\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>gbase> select microsecond('2021-02-03 13:14:15.123456');\n+-------------------------------------------+\n| microsecond('2021-02-03 13:14:15.123456') |\n+-------------------------------------------+\n|                                    123456 |\n+-------------------------------------------+\n1 row in set (Elapsed: 00:00:00.00)<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"sysdate\"><\/span>sysdate<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u5f53\u524d\u7684\u65e5\u671f\u548c\u65f6\u95f4\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>gbase> select sysdate();\n+---------------------+\n| sysdate()           |\n+---------------------+\n| 2021-01-07 17:09:33 |\n+---------------------+\n1 row in set (Elapsed: 00:00:00.00)<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"utc_date\"><\/span>utc_date<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u83b7\u53d6\u5f53\u524dUTC\u7684\u65e5\u671f\uff0c\u4e0d\u5305\u62ec\u65f6\u95f4\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>gbase> select utc_date,utc_date();\n+------------+------------+\n| utc_date   | utc_date() |\n+------------+------------+\n| 2021-01-07 | 2021-01-07 |\n+------------+------------+\n1 row in set (Elapsed: 00:00:00.00)<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"utc_datetime\"><\/span>utc_datetime<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u83b7\u53d6\u5f53\u524dUTC\u7684\u65e5\u671f\u548c\u65f6\u95f4\uff0c\u5305\u62ec\u6beb\u79d2\u5fae\u79d2\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>gbase> select utc_datetime,utc_datetime();\n+----------------------------+----------------------------+\n| utc_datetime               | utc_datetime()             |\n+----------------------------+----------------------------+\n| 2021-01-07 09:27:43.412631 | 2021-01-07 09:27:43.412631 |\n+----------------------------+----------------------------+\n1 row in set (Elapsed: 00:00:00.00)<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"utc_time\"><\/span>utc_time<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u83b7\u53d6\u5f53\u524dUTC\u7684\u65f6\u95f4\uff0c\u4e0d\u5305\u62ec\u65e5\u671f\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>gbase&gt; select utc_time();\n+------------+\ngbase&gt; select utc_time,utc_time();\n+----------+------------+\n| utc_time | utc_time() |\n+----------+------------+\n| 09:27:23 | 09:27:23   |\n+----------+------------+\n1 row in set (Elapsed: 00:00:00.01)<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"utc_timestamp\"><\/span>utc_timestamp<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u83b7\u53d6\u5f53\u524dUTC\u7684\u65f6\u95f4\u548c\u65e5\u671f\u3002\u65e0\u6beb\u79d2\u5fae\u79d2\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>gbase> select utc_timestamp;\n+---------------------+\n| utc_timestamp       |\n+---------------------+\n| 2021-01-07 09:36:14 |\n+---------------------+\n1 row in set (Elapsed: 00:00:00.01)\n\ngbase> select utc_timestamp();\n+---------------------+\n| utc_timestamp()     |\n+---------------------+\n| 2021-01-07 09:36:46 |\n+---------------------+\n1 row in set (Elapsed: 00:00:00.00)<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E5%8F%82%E8%80%83\"><\/span>\u53c2\u8003<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-\u8001\u7d2b\u7af9\u7684\u5bb6 wp-block-embed-\u8001\u7d2b\u7af9\u7684\u5bb6\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"Nesvdb4FFP\"><a href=\"https:\/\/www.gbase8.cn\/en\/2672\/\">GBase 8a\u5b57\u7b26\u4e32\u548c\u65e5\u671f\u51fd\u6570\u5217\u8868\u7d22\u5f15<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"\u300aGBase 8a\u5b57\u7b26\u4e32\u548c\u65e5\u671f\u51fd\u6570\u5217\u8868\u7d22\u5f15\u300b\u2014\u8001\u7d2b\u7af9\u7684\u5bb6\" src=\"https:\/\/www.gbase8.cn\/2672\/embed#?secret=Nesvdb4FFP\" data-secret=\"Nesvdb4FFP\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>","protected":false},"excerpt":{"rendered":"<p>\u672c\u6587\u4ecb\u7ecdGBase 8a\u6570\u636e\u5e93\u96c6\u7fa4\u91cc\uff0c\u83b7\u5f97\u5f53\u524d\u65e5\u671f\uff0c\u65f6\u95f4\uff0c\u6beb\u79d2\u5fae\u79d2\u7684\u51e0\u4e2a\u51fd\u6570\u7684\u4f7f\u7528\u65b9\u6cd5<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[36,67],"class_list":["post-3105","post","type-post","status-publish","format-standard","hentry","category-gbase8a","tag-36","tag-67"],"_links":{"self":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts\/3105","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/comments?post=3105"}],"version-history":[{"count":13,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts\/3105\/revisions"}],"predecessor-version":[{"id":5054,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts\/3105\/revisions\/5054"}],"wp:attachment":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/media?parent=3105"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/categories?post=3105"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/tags?post=3105"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}