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>
53 lines
6.2 KiB
HTML
53 lines
6.2 KiB
HTML
<a name="dli_spark_daydayofmonth"></a><a name="dli_spark_daydayofmonth"></a>
|
|
|
|
<h1 class="topictitle1">day/dayofmonth</h1>
|
|
<div id="body8662426"><p id="dli_spark_daydayofmonth__en-us_topic_0000001645795530_p990811211817">This function is used to return the day of a specified date.</p>
|
|
<div class="section" id="dli_spark_daydayofmonth__en-us_topic_0000001645795530_section45291954203217"><h4 class="sectiontitle">Syntax</h4><pre class="screen" id="dli_spark_daydayofmonth__en-us_topic_0000001645795530_screen2121185651218">day(string date), dayofmonth(string date)</pre>
|
|
</div>
|
|
<div class="section" id="dli_spark_daydayofmonth__en-us_topic_0000001645795530_section992014913317"><h4 class="sectiontitle">Parameters</h4>
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="dli_spark_daydayofmonth__en-us_topic_0000001645795530_table1829154762513" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameter</caption><thead align="left"><tr id="dli_spark_daydayofmonth__en-us_topic_0000001645795530_row8830104792517"><th align="left" class="cellrowborder" valign="top" width="19.220000000000002%" id="mcps1.3.3.2.2.5.1.1"><p id="dli_spark_daydayofmonth__en-us_topic_0000001645795530_p983074711252">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="13.43%" id="mcps1.3.3.2.2.5.1.2"><p id="dli_spark_daydayofmonth__en-us_topic_0000001645795530_p6830124732517">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="20.62%" id="mcps1.3.3.2.2.5.1.3"><p id="dli_spark_daydayofmonth__en-us_topic_0000001645795530_p13318164512614">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="46.73%" id="mcps1.3.3.2.2.5.1.4"><p id="dli_spark_daydayofmonth__en-us_topic_0000001645795530_p08301547132513">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="dli_spark_daydayofmonth__en-us_topic_0000001645795530_row15830184792511"><td class="cellrowborder" valign="top" width="19.220000000000002%" headers="mcps1.3.3.2.2.5.1.1 "><p id="dli_spark_daydayofmonth__en-us_topic_0000001645795530_p683034714250">date</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="13.43%" headers="mcps1.3.3.2.2.5.1.2 "><p id="dli_spark_daydayofmonth__en-us_topic_0000001645795530_p12830184752518">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="20.62%" headers="mcps1.3.3.2.2.5.1.3 "><p id="dli_spark_daydayofmonth__en-us_topic_0000001645795530_p2098843181320">DATE</p>
|
|
<p id="dli_spark_daydayofmonth__en-us_topic_0000001645795530_p158591444191319">or</p>
|
|
<p id="dli_spark_daydayofmonth__en-us_topic_0000001645795530_p0318545102615">STRING</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="46.73%" headers="mcps1.3.3.2.2.5.1.4 "><p id="dli_spark_daydayofmonth__en-us_topic_0000001645795530_p189251333161511">Date that needs to be processed</p>
|
|
<p id="dli_spark_daydayofmonth__en-us_topic_0000001645795530_p262017013166">The following formats are supported:</p>
|
|
<ul id="dli_spark_daydayofmonth__en-us_topic_0000001645795530_ul18403171617"><li id="dli_spark_daydayofmonth__en-us_topic_0000001645795530_li20849331611">yyyy-mm-dd</li><li id="dli_spark_daydayofmonth__en-us_topic_0000001645795530_li9841137169">yyyy-mm-dd hh:mi:ss</li><li id="dli_spark_daydayofmonth__en-us_topic_0000001645795530_li784203121614">yyyy-mm-dd hh:mi:ss.ff3</li></ul>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="dli_spark_daydayofmonth__en-us_topic_0000001645795530_section210162513312"><h4 class="sectiontitle">Return Values</h4><p id="dli_spark_daydayofmonth__en-us_topic_0000001645795530_p42614331442">The return value is of the INT type.</p>
|
|
<div class="note" id="dli_spark_daydayofmonth__en-us_topic_0000001645795530_note61422099395"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="dli_spark_daydayofmonth__en-us_topic_0000001645795530_ul3717447184410"><li id="dli_spark_daydayofmonth__en-us_topic_0000001645795530_li87176472441">If the value of <strong id="dli_spark_daydayofmonth__en-us_topic_0000001645795530_b61634539035749">date</strong> is not of the DATE or STRING type, the error message "data type mismatch" is displayed.</li><li id="dli_spark_daydayofmonth__en-us_topic_0000001645795530_li958213319373">If the value of <strong id="dli_spark_daydayofmonth__en-us_topic_0000001645795530_b33214635235759">date</strong> is of the DATE or STRING type but is not in one of the supported formats, <strong id="dli_spark_daydayofmonth__en-us_topic_0000001645795530_b161686588835759">NULL</strong> is returned.</li><li id="dli_spark_daydayofmonth__en-us_topic_0000001645795530_li971713473442">If the value of <strong id="dli_spark_daydayofmonth__en-us_topic_0000001645795530_b177725282535817">date</strong> is <strong id="dli_spark_daydayofmonth__en-us_topic_0000001645795530_b174353974835817">NULL</strong>, <strong id="dli_spark_daydayofmonth__en-us_topic_0000001645795530_b110549933435817">NULL</strong> is returned.</li></ul>
|
|
</div></div>
|
|
</div>
|
|
<div class="section" id="dli_spark_daydayofmonth__en-us_topic_0000001645795530_section13277192233920"><h4 class="sectiontitle">Example Code</h4><p id="dli_spark_daydayofmonth__en-us_topic_0000001645795530_p152201422185219">The value <strong id="dli_spark_daydayofmonth__en-us_topic_0000001645795530_b41047153568">1</strong> is returned.</p>
|
|
<pre class="screen" id="dli_spark_daydayofmonth__en-us_topic_0000001645795530_screen3990327175212">select day('2023-08-01');</pre>
|
|
<p id="dli_spark_daydayofmonth__en-us_topic_0000001645795530_p9220122211521">The value <strong id="dli_spark_daydayofmonth__en-us_topic_0000001645795530_b445319180569">NULL</strong> is returned.</p>
|
|
<pre class="screen" id="dli_spark_daydayofmonth__en-us_topic_0000001645795530_screen0225103313527">select day('20230816');</pre>
|
|
<p id="dli_spark_daydayofmonth__en-us_topic_0000001645795530_p16220722145213">The value <strong id="dli_spark_daydayofmonth__en-us_topic_0000001645795530_b27181621165614">NULL</strong> is returned.</p>
|
|
<pre class="screen" id="dli_spark_daydayofmonth__en-us_topic_0000001645795530_screen541318394527">select day(null);</pre>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="dli_08_0471.html">Date Functions</a></div>
|
|
</div>
|
|
</div>
|
|
|