forked from docs/doc-exports
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com> Co-authored-by: Su, Xiaomeng <suxiaomeng1@huawei.com> Co-committed-by: Su, Xiaomeng <suxiaomeng1@huawei.com>
167 lines
19 KiB
HTML
167 lines
19 KiB
HTML
<a name="dli_08_0097"></a><a name="dli_08_0097"></a>
|
|
|
|
<h1 class="topictitle1">Temporal Functions</h1>
|
|
<div id="body1574406512517"><p id="dli_08_0097__a0afc1542d28746fc9572e1ad11e28d5d"><a href="#dli_08_0097__ta2a0e6534d354c7195ebf06580c6c081">Table 1</a> lists the time functions supported by Flink SQL.</p>
|
|
<div class="section" id="dli_08_0097__section565310510264"><h4 class="sectiontitle">Function Description</h4>
|
|
<div class="tablenoborder"><a name="dli_08_0097__ta2a0e6534d354c7195ebf06580c6c081"></a><a name="ta2a0e6534d354c7195ebf06580c6c081"></a><table cellpadding="4" cellspacing="0" summary="" id="dli_08_0097__ta2a0e6534d354c7195ebf06580c6c081" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Time functions</caption><thead align="left"><tr id="dli_08_0097__r94e9c30c23dd4af3908643ddb78b35c7"><th align="left" class="cellrowborder" valign="top" width="26.732673267326735%" id="mcps1.3.2.2.2.4.1.1"><p id="dli_08_0097__af3c0a9ba4b4f47dab3c76ec63484ed7f">Function</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="13.861386138613863%" id="mcps1.3.2.2.2.4.1.2"><p id="dli_08_0097__en-us_topic_0060575890_p062042117432">Return Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="59.4059405940594%" id="mcps1.3.2.2.2.4.1.3"><p id="dli_08_0097__aa80b70b4f1624621a61e741988c5d582">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="dli_08_0097__r2d5dbdcae7e949b1bda4187fec7e1840"><td class="cellrowborder" valign="top" width="26.732673267326735%" headers="mcps1.3.2.2.2.4.1.1 "><p id="dli_08_0097__ac86f61fa314d4836821b7c19d57ed457">DATE string</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.2.2.2.4.1.2 "><p id="dli_08_0097__a6390bb9c83434bf1abc803877f93c5fd">DATE</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="59.4059405940594%" headers="mcps1.3.2.2.2.4.1.3 "><p id="dli_08_0097__en-us_topic_0060575890_p097102217463">Parse the date string (<span class="parmname" id="dli_08_0097__parmname795050498164221"><b>yyyy-<span id="dli_08_0097__text1715471194164221">MM</span>-dd</b></span>) to a SQL date.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_08_0097__re6037d00a4ca402aba8919a6a11ea8e4"><td class="cellrowborder" valign="top" width="26.732673267326735%" headers="mcps1.3.2.2.2.4.1.1 "><p id="dli_08_0097__en-us_topic_0060575890_p66208213435">TIME string</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.2.2.2.4.1.2 "><p id="dli_08_0097__afc52ddf9a3494f5cada4cae31e07326c">TIME</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="59.4059405940594%" headers="mcps1.3.2.2.2.4.1.3 "><p id="dli_08_0097__en-us_topic_0060575890_p362162194314">Parse the time string (<span class="parmname" id="dli_08_0097__parmname1427001210164239"><b><span id="dli_08_0097__text23624353164239">HH</span><span id="dli_08_0097__text1661153023164239">:</span>mm<span id="dli_08_0097__text1579717601164239">:</span>ss</b></span>) to the SQL time.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_08_0097__r09c43fb588884afd86c80c79a92d92b0"><td class="cellrowborder" valign="top" width="26.732673267326735%" headers="mcps1.3.2.2.2.4.1.1 "><p id="dli_08_0097__en-us_topic_0060575890_p062182113439">TIMESTAMP string</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.2.2.2.4.1.2 "><p id="dli_08_0097__a59ddaba2be4d49bb989825b24c45e7d6">TIMESTAMP</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="59.4059405940594%" headers="mcps1.3.2.2.2.4.1.3 "><p id="dli_08_0097__a8e5a140307a44c7a9bba48033ce4096a">Convert the time string into timestamp. The time string format is <span class="parmname" id="dli_08_0097__parmname489945411114746"><b>yyyy-<span id="dli_08_0097__text399440498114746">MM</span>-dd <span id="dli_08_0097__text1250559248114746">HH</span><span id="dli_08_0097__text1877526969114746">:</span>mm<span id="dli_08_0097__text244216371114746">:</span>ss.fff</b></span>.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_08_0097__r02301fcf0eb94f9eb6ffa285ba5399c0"><td class="cellrowborder" valign="top" width="26.732673267326735%" headers="mcps1.3.2.2.2.4.1.1 "><p id="dli_08_0097__a07ebf2beb37442a8bc0510aa92ae391d">INTERVAL string range</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.2.2.2.4.1.2 "><p id="dli_08_0097__en-us_topic_0060575890_p257191085014">INTERVAL</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="59.4059405940594%" headers="mcps1.3.2.2.2.4.1.3 "><p id="dli_08_0097__en-us_topic_0060575890_p34549219522">There are two types of intervals: <span class="parmname" id="dli_08_0097__parmname106185952416475"><b>yyyy-<span id="dli_08_0097__text157993161216475">MM</span></b></span> and <span class="parmname" id="dli_08_0097__parmname159493315911486"><b>dd HH:mm:sss.fff'</b></span>. The range of yyyy-MM can be YEAR or YEAR TO MONTH, with the precision of month. The range of dd HH:mm:sss.fff' can be DAY TO HOUR, DAY TO MINUTE, DAY TO SECOND, or DAY TO MILLISECONDS, with the precision of millisecond. For example, if the range is DAY TO SECOND, the day, hour, minute, and second are all valid and the precision is second. DAY TO MINUTE indicates that the precision is minute.</p>
|
|
<p id="dli_08_0097__ad8b72792fc774a84a83eb8aa23ec9423">The following is an example:</p>
|
|
<p id="dli_08_0097__p10145102112514"><strong id="dli_08_0097__b8423527061796">INTERVAL '10 00:00:00.004' DAY TO milliseconds</strong> indicates that the interval is 10 days and 4 milliseconds.</p>
|
|
<p id="dli_08_0097__en-us_topic_0060575890_p849154571214"><strong id="dli_08_0097__b84235270617108">INTERVAL '10' DAY</strong> indicates that the interval is 10 days and <strong id="dli_08_0097__b842352706171012">INTERVAL '2-10' YEAR TO MONTH</strong> indicates that the interval is 2 years and 10 months.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_08_0097__r452fd9bcac904451a132b11e8b93d994"><td class="cellrowborder" valign="top" width="26.732673267326735%" headers="mcps1.3.2.2.2.4.1.1 "><p id="dli_08_0097__a6965d1077bf6425f9aa006163ededed0">CURRENT_DATE</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.2.2.2.4.1.2 "><p id="dli_08_0097__a1a61c57d956e436f82015b10e1fa1c6a">DATE</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="59.4059405940594%" headers="mcps1.3.2.2.2.4.1.3 "><p id="dli_08_0097__en-us_topic_0060575890_p2938947522">Return the SQL date of UTC time zone.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_08_0097__r814ffb81098d45b9bb8e6afe4d135390"><td class="cellrowborder" valign="top" width="26.732673267326735%" headers="mcps1.3.2.2.2.4.1.1 "><p id="dli_08_0097__en-us_topic_0060575890_p7541167406">CURRENT_TIME</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.2.2.2.4.1.2 "><p id="dli_08_0097__a22a3f9e012eb4a48a21a17b131fbeaf3">TIME</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="59.4059405940594%" headers="mcps1.3.2.2.2.4.1.3 "><p id="dli_08_0097__ad8f46723d2334db5b440bce0c5f31e14">Return the SQL time of UTC time zone.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_08_0097__r4ce2696a760c453eb3982feb3a50b630"><td class="cellrowborder" valign="top" width="26.732673267326735%" headers="mcps1.3.2.2.2.4.1.1 "><p id="dli_08_0097__a1249662b8bff4bef8086c9fe4a13f29a">CURRENT_TIMESTAMP</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.2.2.2.4.1.2 "><p id="dli_08_0097__a20c5d0b9ef3c4b2bb09c8a301d2775c3">TIMESTAMP</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="59.4059405940594%" headers="mcps1.3.2.2.2.4.1.3 "><p id="dli_08_0097__a063e702dfd5b4a4497ee9fd2f2198d18">Return the SQL timestamp of UTC time zone.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_08_0097__r2501ad96582b42b8a16a6d9ee6472488"><td class="cellrowborder" valign="top" width="26.732673267326735%" headers="mcps1.3.2.2.2.4.1.1 "><p id="dli_08_0097__en-us_topic_0060575890_p852131644019">LOCALTIME</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.2.2.2.4.1.2 "><p id="dli_08_0097__aaed36ae8f2dd4bc191f803537d5fd285">TIME</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="59.4059405940594%" headers="mcps1.3.2.2.2.4.1.3 "><p id="dli_08_0097__a124cad95c1d245a8b14fe7fb4ddb9897">Return the SQL time of the current time zone.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_08_0097__r2e3fbb4619bb40ccbc11d29a22f86d83"><td class="cellrowborder" valign="top" width="26.732673267326735%" headers="mcps1.3.2.2.2.4.1.1 "><p id="dli_08_0097__af689318e7c264e62aa4b2421fe20a36d">LOCALTIMESTAMP</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.2.2.2.4.1.2 "><p id="dli_08_0097__adb38d4dbf6654577ae44c14eb7c8911d">TIMESTAMP</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="59.4059405940594%" headers="mcps1.3.2.2.2.4.1.3 "><p id="dli_08_0097__a85b54e5560b74f31a5e9112f92ae4b84">Return the SQL timestamp of the current time zone.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_08_0097__rf661654af51b42999987cea96ef62a53"><td class="cellrowborder" valign="top" width="26.732673267326735%" headers="mcps1.3.2.2.2.4.1.1 "><p id="dli_08_0097__en-us_topic_0060575890_p7507165405">EXTRACT(timeintervalunit FROM temporal)</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.2.2.2.4.1.2 "><p id="dli_08_0097__en-us_topic_0060575890_p8530105500">INT</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="59.4059405940594%" headers="mcps1.3.2.2.2.4.1.3 "><p id="dli_08_0097__aec44d12f22134b7d8d9f30ce54de302d">Extract part of the time point or interval. Return the part in the int type.</p>
|
|
<p id="dli_08_0097__a2db479eec5b24736bb5691fc968a67f3">For example, <strong id="dli_08_0097__b3810315171612">5</strong> is returned from <strong id="dli_08_0097__b1243112454168">EXTRACT(DAY FROM DATE "2006-06-05")</strong>.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_08_0097__r8afc17cc7bb54c628fe5f4251caa88c4"><td class="cellrowborder" valign="top" width="26.732673267326735%" headers="mcps1.3.2.2.2.4.1.1 "><p id="dli_08_0097__en-us_topic_0060575890_p849201674016">FLOOR(timepoint TO timeintervalunit)</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.2.2.2.4.1.2 "><p id="dli_08_0097__en-us_topic_0060575890_p105213101506">TIME</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="59.4059405940594%" headers="mcps1.3.2.2.2.4.1.3 "><p id="dli_08_0097__en-us_topic_0060575890_p767411111020">Round a time point down to the given unit.</p>
|
|
<p id="dli_08_0097__en-us_topic_0060575890_p15204518213">For example, <strong id="dli_08_0097__b842352706171216">12:44:00</strong> is returned from <strong id="dli_08_0097__b842352706171239">FLOOR(TIME '12:44:31' TO MINUTE)</strong>.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_08_0097__rf15eca3acc9f45f0b5d22d683a371b87"><td class="cellrowborder" valign="top" width="26.732673267326735%" headers="mcps1.3.2.2.2.4.1.1 "><p id="dli_08_0097__ae997331fb137429b858aaafd60efdf1d">CEIL(timepoint TO timeintervalunit)</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.2.2.2.4.1.2 "><p id="dli_08_0097__en-us_topic_0060575890_p15111018504">TIME</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="59.4059405940594%" headers="mcps1.3.2.2.2.4.1.3 "><p id="dli_08_0097__en-us_topic_0060575890_p10356234429">Round a time point up to the given unit.</p>
|
|
<p id="dli_08_0097__en-us_topic_0060575890_p179131918167">For example, <strong id="dli_08_0097__b1541853222">12:45:00</strong> is returned from CEIL(TIME '12:44:31' TO MINUTE).</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_08_0097__rb8a538b23a764643bb5931adc3bcc67e"><td class="cellrowborder" valign="top" width="26.732673267326735%" headers="mcps1.3.2.2.2.4.1.1 "><p id="dli_08_0097__a1e770202a4de4926ba0c1f76ba190a28">QUARTER(date)</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.2.2.2.4.1.2 "><p id="dli_08_0097__a1362ed73d8af4cf3acec2f8494363a82">INT</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="59.4059405940594%" headers="mcps1.3.2.2.2.4.1.3 "><p id="dli_08_0097__en-us_topic_0060575890_p163979454468">Return the quarter from the SQL date.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_08_0097__r270f4b134510469faab720497ebef068"><td class="cellrowborder" valign="top" width="26.732673267326735%" headers="mcps1.3.2.2.2.4.1.1 "><p id="dli_08_0097__ab2125021884c43c2a313f0ee0e4129e1">(timepoint, temporal) OVERLAPS (timepoint, temporal)</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.2.2.2.4.1.2 "><p id="dli_08_0097__adeb735fedd3f4407900d03e7016d8f01">BOOLEAN</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="59.4059405940594%" headers="mcps1.3.2.2.2.4.1.3 "><p id="dli_08_0097__en-us_topic_0060575890_p187813192161">Check whether two intervals overlap. The time points and time are converted into a time range with a start point and an end point. The function is <i><b><span class="cmdname" style="font-family:Arial" id="dli_08_0097__cmdname168802565413">leftEnd >= rightStart && rightEnd >= leftStart</span></b></i>. If leftEnd is greater than or equal to rightStart and rightEnd is greater than or equal to leftStart, <strong id="dli_08_0097__b84235270617212">true</strong> is returned. Otherwise, <strong id="dli_08_0097__b84235270617216">false</strong> is returned.</p>
|
|
<p id="dli_08_0097__ae35e5806b0ab4fc5a6488138f40b0f12">The following is an example:</p>
|
|
<ul id="dli_08_0097__u170ef7aad44f4cefb6da95e891873b48"><li id="dli_08_0097__lda90c7759f794290946a93d0664645f4">If leftEnd is <span class="uicontrol" id="dli_08_0097__en-us_topic_0060575890_uicontrol121391332162718"><b>3:55:00</b></span> (2:55:00+1:00:00), rightStart is <span class="uicontrol" id="dli_08_0097__en-us_topic_0060575890_uicontrol613953218277"><b>3:30:00</b></span>, rightEnd is <span class="uicontrol" id="dli_08_0097__en-us_topic_0060575890_uicontrol1113963292712"><b>5:30:00</b></span> (3:30:00+2:00:00), and leftStart is <span class="uicontrol" id="dli_08_0097__en-us_topic_0060575890_uicontrol4139183222718"><b>2:55:00</b></span>, <strong id="dli_08_0097__b84235270614508">true</strong> will be returned.<p id="dli_08_0097__ac7849c7443c74c27a49d8862e35ebe7b">Specifically, <strong id="dli_08_0097__b842352706172316">true</strong> is returned from (TIME '2:55:00', INTERVAL '1' HOUR) OVERLAPS (TIME '3:30:00', INTERVAL '2' HOUR).</p>
|
|
</li></ul>
|
|
<ul id="dli_08_0097__u215dc39bc81e4cc9ab475aa8a9c0ebcb"><li id="dli_08_0097__l20565aae8d024ecc8963ebc9274869f6">If leftEnd is <span class="uicontrol" id="dli_08_0097__en-us_topic_0060575890_uicontrol1191895102718"><b>10:00:00</b></span>, rightStart is <span class="uicontrol" id="dli_08_0097__en-us_topic_0060575890_uicontrol159181351172717"><b>10:15:00</b></span>, rightEnd is <span class="uicontrol" id="dli_08_0097__en-us_topic_0060575890_uicontrol12918195115276"><b>13:15:00</b></span> (10:15:00+3:00:00), and leftStart is <span class="uicontrol" id="dli_08_0097__en-us_topic_0060575890_uicontrol691865117272"><b>9:00:00</b></span>, <strong id="dli_08_0097__b84235270614525">false</strong> will be returned.<p id="dli_08_0097__a0cbbb25ac4684110b5604cf476470dcf">Specifically, <strong id="dli_08_0097__b842352706172344">false</strong> is returned from (TIME '9:00:00', TIME '10:00:00') OVERLAPS (TIME '10:15:00', INTERVAL '3' HOUR).</p>
|
|
</li></ul>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_08_0097__row184130214507"><td class="cellrowborder" valign="top" width="26.732673267326735%" headers="mcps1.3.2.2.2.4.1.1 "><p id="dli_08_0097__p1511613154714">TO_TIMESTAMP(long expr)</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.2.2.2.4.1.2 "><p id="dli_08_0097__p14413821195019">TIMESTAMP</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="59.4059405940594%" headers="mcps1.3.2.2.2.4.1.3 "><p id="dli_08_0097__p194132213503">Convert a timestamp to time.</p>
|
|
<p id="dli_08_0097__p1750831174114">The input parameter this function must be of the BIGINT type. Other data types, such as VARCHAR and STRING, are not supported.</p>
|
|
<p id="dli_08_0097__p1849374315382">For example, <strong id="dli_08_0097__b168861302618">TO_TIMESTAMP (1628765159000)</strong> is converted to <strong id="dli_08_0097__b479854913516">2021-08-12 18:45:59</strong>.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_08_0097__row394214188117"><td class="cellrowborder" valign="top" width="26.732673267326735%" headers="mcps1.3.2.2.2.4.1.1 "><p id="dli_08_0097__p16257174365118">UNIX_TIMESTAMP</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.2.2.2.4.1.2 "><p id="dli_08_0097__p169421181712">BIGINT</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="59.4059405940594%" headers="mcps1.3.2.2.2.4.1.3 "><p id="dli_08_0097__p1224974518464">Returns the timestamp of a specified parameter. The timestamp type is BIGINT and the unit is <span class="parmvalue" id="dli_08_0097__parmvalue14653856632"><b>second</b></span>.</p>
|
|
<p id="dli_08_0097__p1494211815110">The following methods are supported:</p>
|
|
<ul id="dli_08_0097__ul75661362495"><li id="dli_08_0097__li165660614916">UNIX_TIMESTAMP(): returns the timestamp of the current time if no parameter is specified.</li><li id="dli_08_0097__li1256612619492">UNIX_TIMESTAMP(STRING datestr): returns the timestamp indicated by the parameter if only one parameter is contained. The format of <strong id="dli_08_0097__b13430622191915">datestr</strong> must be yyyy-MM-dd HH:mm:ss.</li><li id="dli_08_0097__li55666624916">UNIX_TIMESTAMP(STRING datestr, STRING format): returns the timestamp indicated by the first parameter if two parameters are contained. The second parameter can specify the format of <strong id="dli_08_0097__b19687173892017">datestr</strong>.</li></ul>
|
|
</td>
|
|
</tr>
|
|
<tr id="dli_08_0097__row42721837195017"><td class="cellrowborder" valign="top" width="26.732673267326735%" headers="mcps1.3.2.2.2.4.1.1 "><p id="dli_08_0097__p9754164615010">UNIX_TIMESTAMP_MS</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.2.2.2.4.1.2 "><p id="dli_08_0097__p14758154635018">BIGINT</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="59.4059405940594%" headers="mcps1.3.2.2.2.4.1.3 "><p id="dli_08_0097__p275913466505">Returns the timestamp of a specified parameter. The timestamp type is BIGINT and the unit is <span class="parmvalue" id="dli_08_0097__parmvalue1729474046"><b>millisecond</b></span>.</p>
|
|
<p id="dli_08_0097__p127608464509">The following methods are supported:</p>
|
|
<ul id="dli_08_0097__ul117612046175011"><li id="dli_08_0097__li1476224655014">UNIX_TIMESTAMP_MS(): returns the timestamp of the current time if no parameter is specified.</li><li id="dli_08_0097__li276324614509">UNIX_TIMESTAMP_MS(STRING datestr): returns the timestamp indicated by the parameter if only one parameter is contained. The format of <strong id="dli_08_0097__b1029351215918">datestr</strong> must be yyyy-MM-dd HH:mm:ss.SSS.</li><li id="dli_08_0097__li876454612506">UNIX_TIMESTAMP_MS(STRING datestr, STRING format): returns the timestamp indicated by the first parameter if two parameters are contained. The second parameter can specify the format of <strong id="dli_08_0097__b1801428291">datestr</strong>.</li></ul>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="dli_08_0097__section592413174265"><h4 class="sectiontitle">Precautions</h4><p id="dli_08_0097__p99319819195">None</p>
|
|
</div>
|
|
<div class="section" id="dli_08_0097__section514122112613"><h4 class="sectiontitle">Example</h4><pre class="screen" id="dli_08_0097__screen49331387198">insert into temp SELECT Date '2015-10-11' FROM OrderA;//Date is returned
|
|
insert into temp1 SELECT Time '12:14:50' FROM OrderA;//Time is returned
|
|
insert into temp2 SELECT Timestamp '2015-10-11 12:14:50' FROM OrderA;//Timestamp is returned</pre>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="dli_08_0086.html">Built-In Functions</a></div>
|
|
</div>
|
|
</div>
|
|
|