doc-exports/docs/dws/dev/dws_06_0312.html
Lu, Huayi ef0ada5a59 DWS DEV 20240716 version
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Co-authored-by: Lu, Huayi <luhuayi@huawei.com>
Co-committed-by: Lu, Huayi <luhuayi@huawei.com>
2024-11-02 09:07:47 +00:00

291 lines
25 KiB
HTML

<a name="EN-US_TOPIC_0000001510161265"></a><a name="EN-US_TOPIC_0000001510161265"></a>
<h1 class="topictitle1">date_format</h1>
<div id="body0000001453203736"><div class="section" id="EN-US_TOPIC_0000001510161265__section65590906"><h4 class="sectiontitle">date_format(timestamp, fmt)</h4><p id="EN-US_TOPIC_0000001510161265__p84116013012">Converts a date into a string in the format specified by <strong id="EN-US_TOPIC_0000001510161265__b332173128101721">fmt</strong>.</p>
<p id="EN-US_TOPIC_0000001510161265__p18412016016">Example:</p>
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001510161265__screen12421509018"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal"> 1</span>
<span class="normal"> 2</span>
<span class="normal"> 3</span>
<span class="normal"> 4</span>
<span class="normal"> 5</span>
<span class="normal"> 6</span>
<span class="normal"> 7</span>
<span class="normal"> 8</span>
<span class="normal"> 9</span>
<span class="normal">10</span>
<span class="normal">11</span>
<span class="normal">12</span>
<span class="normal">13</span>
<span class="normal">14</span>
<span class="normal">15</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">SELECT</span><span class="w"> </span><span class="n">date_format</span><span class="p">(</span><span class="s1">'2009-10-04 22:23:00'</span><span class="p">,</span><span class="w"> </span><span class="s1">'%M %D %W'</span><span class="p">);</span>
<span class="w"> </span><span class="n">date_format</span>
<span class="c1">--------------------</span>
<span class="w"> </span><span class="n">October</span><span class="w"> </span><span class="mi">4</span><span class="n">th</span><span class="w"> </span><span class="n">Sunday</span>
<span class="p">(</span><span class="mi">1</span><span class="w"> </span><span class="k">row</span><span class="p">)</span>
<span class="k">SELECT</span><span class="w"> </span><span class="n">date_format</span><span class="p">(</span><span class="s1">'2021-02-20 08:30:45'</span><span class="p">,</span><span class="w"> </span><span class="s1">'%Y-%m-%d %H:%i:%S'</span><span class="p">);</span>
<span class="w"> </span><span class="n">date_format</span>
<span class="c1">---------------------</span>
<span class="w"> </span><span class="mi">2021</span><span class="o">-</span><span class="mi">02</span><span class="o">-</span><span class="mi">20</span><span class="w"> </span><span class="mi">08</span><span class="p">:</span><span class="mi">30</span><span class="p">:</span><span class="mi">45</span>
<span class="p">(</span><span class="mi">1</span><span class="w"> </span><span class="k">row</span><span class="p">)</span>
<span class="k">SELECT</span><span class="w"> </span><span class="n">date_format</span><span class="p">(</span><span class="s1">'2021-02-20 18:10:15'</span><span class="p">,</span><span class="w"> </span><span class="s1">'%r-%T'</span><span class="p">);</span>
<span class="w"> </span><span class="n">date_format</span>
<span class="c1">----------------------</span>
<span class="w"> </span><span class="mi">06</span><span class="p">:</span><span class="mi">10</span><span class="p">:</span><span class="mi">15</span><span class="w"> </span><span class="n">PM</span><span class="o">-</span><span class="mi">18</span><span class="p">:</span><span class="mi">10</span><span class="p">:</span><span class="mi">15</span>
<span class="p">(</span><span class="mi">1</span><span class="w"> </span><span class="k">row</span><span class="p">)</span>
</pre></div></td></tr></table></div>
</div>
<p id="EN-US_TOPIC_0000001510161265__p04213014015"><a href="#EN-US_TOPIC_0000001510161265__table17541102011">Table 1</a> describes the patterns of date parameter values. They can be used for the <strong id="EN-US_TOPIC_0000001510161265__b1893180164813">date_format</strong>, <strong id="EN-US_TOPIC_0000001510161265__b1793213018485">time_format</strong>, <strong id="EN-US_TOPIC_0000001510161265__b1693217094815">str_to_date</strong>, <strong id="EN-US_TOPIC_0000001510161265__b193260134816">str_to_time</strong>, and <strong id="EN-US_TOPIC_0000001510161265__b29336013483">from_unixtime</strong> functions.</p>
<div class="tablenoborder"><a name="EN-US_TOPIC_0000001510161265__table17541102011"></a><a name="table17541102011"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001510161265__table17541102011" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Formats for the output string</caption><thead align="left"><tr id="EN-US_TOPIC_0000001510161265__row843207018"><th align="left" class="cellrowborder" valign="top" width="13.86%" id="mcps1.3.1.6.2.4.1.1"><p id="EN-US_TOPIC_0000001510161265__p13421309017">Format</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="38.440000000000005%" id="mcps1.3.1.6.2.4.1.2"><p id="EN-US_TOPIC_0000001510161265__p10439013014">Description</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="47.699999999999996%" id="mcps1.3.1.6.2.4.1.3"><p id="EN-US_TOPIC_0000001510161265__p1343701012">Value</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001510161265__row11439017012"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.1.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001510161265__p16431401705">%a</p>
</td>
<td class="cellrowborder" valign="top" width="38.440000000000005%" headers="mcps1.3.1.6.2.4.1.2 "><p id="EN-US_TOPIC_0000001510161265__p13431201602">Abbreviated week name</p>
</td>
<td class="cellrowborder" valign="top" width="47.699999999999996%" headers="mcps1.3.1.6.2.4.1.3 "><p id="EN-US_TOPIC_0000001510161265__p164313015016">Sun...Sat</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001510161265__row1943401802"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.1.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001510161265__p14431105019">%b</p>
</td>
<td class="cellrowborder" valign="top" width="38.440000000000005%" headers="mcps1.3.1.6.2.4.1.2 "><p id="EN-US_TOPIC_0000001510161265__p843803013">Abbreviated month name</p>
</td>
<td class="cellrowborder" valign="top" width="47.699999999999996%" headers="mcps1.3.1.6.2.4.1.3 "><p id="EN-US_TOPIC_0000001510161265__p194317014013">Jan...Dec</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001510161265__row3449016012"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.1.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001510161265__p74320013016">%c</p>
</td>
<td class="cellrowborder" valign="top" width="38.440000000000005%" headers="mcps1.3.1.6.2.4.1.2 "><p id="EN-US_TOPIC_0000001510161265__p843190906">Month</p>
</td>
<td class="cellrowborder" valign="top" width="47.699999999999996%" headers="mcps1.3.1.6.2.4.1.3 "><p id="EN-US_TOPIC_0000001510161265__p3431209017">0...12</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001510161265__row6443014010"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.1.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001510161265__p1744406015">%D</p>
</td>
<td class="cellrowborder" valign="top" width="38.440000000000005%" headers="mcps1.3.1.6.2.4.1.2 "><p id="EN-US_TOPIC_0000001510161265__p1744701018">Date with a suffix</p>
</td>
<td class="cellrowborder" valign="top" width="47.699999999999996%" headers="mcps1.3.1.6.2.4.1.3 "><p id="EN-US_TOPIC_0000001510161265__p844306010">0th, 1st, 2nd, 3rd, ...</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001510161265__row9441803020"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.1.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001510161265__p34414019017">%d</p>
</td>
<td class="cellrowborder" valign="top" width="38.440000000000005%" headers="mcps1.3.1.6.2.4.1.2 "><p id="EN-US_TOPIC_0000001510161265__p5441701703">Day in a month (two digits)</p>
</td>
<td class="cellrowborder" valign="top" width="47.699999999999996%" headers="mcps1.3.1.6.2.4.1.3 "><p id="EN-US_TOPIC_0000001510161265__p1944001104">00...31</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001510161265__row646809013"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.1.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001510161265__p1744403020">%e</p>
</td>
<td class="cellrowborder" valign="top" width="38.440000000000005%" headers="mcps1.3.1.6.2.4.1.2 "><p id="EN-US_TOPIC_0000001510161265__p344201909">Day in a month</p>
</td>
<td class="cellrowborder" valign="top" width="47.699999999999996%" headers="mcps1.3.1.6.2.4.1.3 "><p id="EN-US_TOPIC_0000001510161265__p10448014015">0...31</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001510161265__row647301011"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.1.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001510161265__p64620506">%f</p>
</td>
<td class="cellrowborder" valign="top" width="38.440000000000005%" headers="mcps1.3.1.6.2.4.1.2 "><p id="EN-US_TOPIC_0000001510161265__p247501502">Microsecond</p>
</td>
<td class="cellrowborder" valign="top" width="47.699999999999996%" headers="mcps1.3.1.6.2.4.1.3 "><p id="EN-US_TOPIC_0000001510161265__p247180408">000000...999999</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001510161265__row447007019"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.1.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001510161265__p1347001505">%H</p>
</td>
<td class="cellrowborder" valign="top" width="38.440000000000005%" headers="mcps1.3.1.6.2.4.1.2 "><p id="EN-US_TOPIC_0000001510161265__p24720011020">Hour, in 24-hour format</p>
</td>
<td class="cellrowborder" valign="top" width="47.699999999999996%" headers="mcps1.3.1.6.2.4.1.3 "><p id="EN-US_TOPIC_0000001510161265__p20479011013">00...23</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001510161265__row1547801011"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.1.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001510161265__p647107017">%h</p>
</td>
<td class="cellrowborder" valign="top" width="38.440000000000005%" headers="mcps1.3.1.6.2.4.1.2 "><p id="EN-US_TOPIC_0000001510161265__p1147001204">Hour, in 12-hour format</p>
</td>
<td class="cellrowborder" valign="top" width="47.699999999999996%" headers="mcps1.3.1.6.2.4.1.3 "><p id="EN-US_TOPIC_0000001510161265__p1471501402">01...12</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001510161265__row124815015011"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.1.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001510161265__p0476019016">%I</p>
</td>
<td class="cellrowborder" valign="top" width="38.440000000000005%" headers="mcps1.3.1.6.2.4.1.2 "><p id="EN-US_TOPIC_0000001510161265__p348600015">Hour, in 12-hour format, same as <strong id="EN-US_TOPIC_0000001510161265__b53550843101721">%h</strong></p>
</td>
<td class="cellrowborder" valign="top" width="47.699999999999996%" headers="mcps1.3.1.6.2.4.1.3 "><p id="EN-US_TOPIC_0000001510161265__p8481605015">01...12</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001510161265__row44815015017"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.1.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001510161265__p04812020017">%i</p>
</td>
<td class="cellrowborder" valign="top" width="38.440000000000005%" headers="mcps1.3.1.6.2.4.1.2 "><p id="EN-US_TOPIC_0000001510161265__p34860008">Minute</p>
</td>
<td class="cellrowborder" valign="top" width="47.699999999999996%" headers="mcps1.3.1.6.2.4.1.3 "><p id="EN-US_TOPIC_0000001510161265__p18481808010">00...59</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001510161265__row12489015019"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.1.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001510161265__p144810017018">%j</p>
</td>
<td class="cellrowborder" valign="top" width="38.440000000000005%" headers="mcps1.3.1.6.2.4.1.2 "><p id="EN-US_TOPIC_0000001510161265__p248100101">Day in a year</p>
</td>
<td class="cellrowborder" valign="top" width="47.699999999999996%" headers="mcps1.3.1.6.2.4.1.3 "><p id="EN-US_TOPIC_0000001510161265__p54818017018">001...366</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001510161265__row34910010010"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.1.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001510161265__p1481801705">%k</p>
</td>
<td class="cellrowborder" valign="top" width="38.440000000000005%" headers="mcps1.3.1.6.2.4.1.2 "><p id="EN-US_TOPIC_0000001510161265__p1648200806">Hour, in 24-hour format, same as <strong id="EN-US_TOPIC_0000001510161265__b305971036101722">%H</strong></p>
</td>
<td class="cellrowborder" valign="top" width="47.699999999999996%" headers="mcps1.3.1.6.2.4.1.3 "><p id="EN-US_TOPIC_0000001510161265__p0492017010">0...23</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001510161265__row0491808014"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.1.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001510161265__p12491601404">%l</p>
</td>
<td class="cellrowborder" valign="top" width="38.440000000000005%" headers="mcps1.3.1.6.2.4.1.2 "><p id="EN-US_TOPIC_0000001510161265__p8498016013">Hour, in 12-hour format, same as <strong id="EN-US_TOPIC_0000001510161265__b726438892101722">%h</strong></p>
</td>
<td class="cellrowborder" valign="top" width="47.699999999999996%" headers="mcps1.3.1.6.2.4.1.3 "><p id="EN-US_TOPIC_0000001510161265__p134990600">1...12</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001510161265__row349900019"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.1.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001510161265__p1049104019">%M</p>
</td>
<td class="cellrowborder" valign="top" width="38.440000000000005%" headers="mcps1.3.1.6.2.4.1.2 "><p id="EN-US_TOPIC_0000001510161265__p849501809">Month name</p>
</td>
<td class="cellrowborder" valign="top" width="47.699999999999996%" headers="mcps1.3.1.6.2.4.1.3 "><p id="EN-US_TOPIC_0000001510161265__p3495016018">January...December</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001510161265__row5491101701"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.1.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001510161265__p16491909018">%m</p>
</td>
<td class="cellrowborder" valign="top" width="38.440000000000005%" headers="mcps1.3.1.6.2.4.1.2 "><p id="EN-US_TOPIC_0000001510161265__p4491018014">Month (two digits)</p>
</td>
<td class="cellrowborder" valign="top" width="47.699999999999996%" headers="mcps1.3.1.6.2.4.1.3 "><p id="EN-US_TOPIC_0000001510161265__p1949301604">00...12</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001510161265__row25010102"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.1.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001510161265__p2491014012">%p</p>
</td>
<td class="cellrowborder" valign="top" width="38.440000000000005%" headers="mcps1.3.1.6.2.4.1.2 "><p id="EN-US_TOPIC_0000001510161265__p9504013011">Morning and afternoon</p>
</td>
<td class="cellrowborder" valign="top" width="47.699999999999996%" headers="mcps1.3.1.6.2.4.1.3 "><p id="EN-US_TOPIC_0000001510161265__p12501001406">AM PM</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001510161265__row850100607"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.1.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001510161265__p1950401600">%r</p>
</td>
<td class="cellrowborder" valign="top" width="38.440000000000005%" headers="mcps1.3.1.6.2.4.1.2 "><p id="EN-US_TOPIC_0000001510161265__p5506016017">Time, in 12-hour format</p>
</td>
<td class="cellrowborder" valign="top" width="47.699999999999996%" headers="mcps1.3.1.6.2.4.1.3 "><p id="EN-US_TOPIC_0000001510161265__p7502001012">hh::mm::ss AM/PM</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001510161265__row185010201"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.1.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001510161265__p1150701403">%S</p>
</td>
<td class="cellrowborder" valign="top" width="38.440000000000005%" headers="mcps1.3.1.6.2.4.1.2 "><p id="EN-US_TOPIC_0000001510161265__p185030408">Second</p>
</td>
<td class="cellrowborder" valign="top" width="47.699999999999996%" headers="mcps1.3.1.6.2.4.1.3 "><p id="EN-US_TOPIC_0000001510161265__p16501808010">00...59</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001510161265__row10511908018"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.1.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001510161265__p1050100017">%s</p>
</td>
<td class="cellrowborder" valign="top" width="38.440000000000005%" headers="mcps1.3.1.6.2.4.1.2 "><p id="EN-US_TOPIC_0000001510161265__p1050306015">Second, same as <strong id="EN-US_TOPIC_0000001510161265__b2009319480101722">%S</strong></p>
</td>
<td class="cellrowborder" valign="top" width="47.699999999999996%" headers="mcps1.3.1.6.2.4.1.3 "><p id="EN-US_TOPIC_0000001510161265__p450180907">00...59</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001510161265__row85115017010"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.1.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001510161265__p451001207">%T</p>
</td>
<td class="cellrowborder" valign="top" width="38.440000000000005%" headers="mcps1.3.1.6.2.4.1.2 "><p id="EN-US_TOPIC_0000001510161265__p125113016020">Time, in 24-hour format</p>
</td>
<td class="cellrowborder" valign="top" width="47.699999999999996%" headers="mcps1.3.1.6.2.4.1.3 "><p id="EN-US_TOPIC_0000001510161265__p19511001808">hh::mm::ss</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001510161265__row1651160103"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.1.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001510161265__p18518018013">%U</p>
</td>
<td class="cellrowborder" valign="top" width="38.440000000000005%" headers="mcps1.3.1.6.2.4.1.2 "><p id="EN-US_TOPIC_0000001510161265__p351120304">Week (Sunday is the first day of a week.)</p>
</td>
<td class="cellrowborder" valign="top" width="47.699999999999996%" headers="mcps1.3.1.6.2.4.1.3 "><p id="EN-US_TOPIC_0000001510161265__p13512018015">00...53</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001510161265__row2511001404"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.1.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001510161265__p6511501203">%u</p>
</td>
<td class="cellrowborder" valign="top" width="38.440000000000005%" headers="mcps1.3.1.6.2.4.1.2 "><p id="EN-US_TOPIC_0000001510161265__p1251100205">Week (Monday is the first day of a week.)</p>
</td>
<td class="cellrowborder" valign="top" width="47.699999999999996%" headers="mcps1.3.1.6.2.4.1.3 "><p id="EN-US_TOPIC_0000001510161265__p251505014">00...53</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001510161265__row17521701015"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.1.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001510161265__p17511013019">%V</p>
</td>
<td class="cellrowborder" valign="top" width="38.440000000000005%" headers="mcps1.3.1.6.2.4.1.2 "><p id="EN-US_TOPIC_0000001510161265__p13513019018">Week (Sunday is the first day of a week). It is used together with <strong id="EN-US_TOPIC_0000001510161265__b93454276101722">%X</strong>.</p>
</td>
<td class="cellrowborder" valign="top" width="47.699999999999996%" headers="mcps1.3.1.6.2.4.1.3 "><p id="EN-US_TOPIC_0000001510161265__p175114015019">01...53</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001510161265__row95210018014"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.1.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001510161265__p1552404010">%v</p>
</td>
<td class="cellrowborder" valign="top" width="38.440000000000005%" headers="mcps1.3.1.6.2.4.1.2 "><p id="EN-US_TOPIC_0000001510161265__p195250108">Week (Monday is the first day of a week). It is used together with <strong id="EN-US_TOPIC_0000001510161265__b289631243101722">%x</strong>.</p>
</td>
<td class="cellrowborder" valign="top" width="47.699999999999996%" headers="mcps1.3.1.6.2.4.1.3 "><p id="EN-US_TOPIC_0000001510161265__p125270106">01...53</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001510161265__row7521504010"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.1.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001510161265__p9521503014">%W</p>
</td>
<td class="cellrowborder" valign="top" width="38.440000000000005%" headers="mcps1.3.1.6.2.4.1.2 "><p id="EN-US_TOPIC_0000001510161265__p195213011018">Week name</p>
</td>
<td class="cellrowborder" valign="top" width="47.699999999999996%" headers="mcps1.3.1.6.2.4.1.3 "><p id="EN-US_TOPIC_0000001510161265__p1452407018">Sunday...Saturday</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001510161265__row552100604"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.1.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001510161265__p12521801606">%w</p>
</td>
<td class="cellrowborder" valign="top" width="38.440000000000005%" headers="mcps1.3.1.6.2.4.1.2 "><p id="EN-US_TOPIC_0000001510161265__p45210016019">Day of a week. The value is <strong id="EN-US_TOPIC_0000001510161265__b1334706717101722">0</strong> for Sunday.</p>
</td>
<td class="cellrowborder" valign="top" width="47.699999999999996%" headers="mcps1.3.1.6.2.4.1.3 "><p id="EN-US_TOPIC_0000001510161265__p05219015016">0...6</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001510161265__row1531301403"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.1.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001510161265__p195214011018">%X</p>
</td>
<td class="cellrowborder" valign="top" width="38.440000000000005%" headers="mcps1.3.1.6.2.4.1.2 "><p id="EN-US_TOPIC_0000001510161265__p1531501605">Year (four digits). It is used together with <strong id="EN-US_TOPIC_0000001510161265__b1166310203101722">%V</strong>. Sunday is the first day of a week.</p>
</td>
<td class="cellrowborder" valign="top" width="47.699999999999996%" headers="mcps1.3.1.6.2.4.1.3 "><p id="EN-US_TOPIC_0000001510161265__p55380208">-</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001510161265__row1853201501"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.1.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001510161265__p85320109">%x</p>
</td>
<td class="cellrowborder" valign="top" width="38.440000000000005%" headers="mcps1.3.1.6.2.4.1.2 "><p id="EN-US_TOPIC_0000001510161265__p85330008">Year (four digits). It is used together with <strong id="EN-US_TOPIC_0000001510161265__b975979983101722">%v</strong>. Monday is the first day of a week.</p>
</td>
<td class="cellrowborder" valign="top" width="47.699999999999996%" headers="mcps1.3.1.6.2.4.1.3 "><p id="EN-US_TOPIC_0000001510161265__p65316017014">-</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001510161265__row1353605018"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.1.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001510161265__p1053008017">%Y</p>
</td>
<td class="cellrowborder" valign="top" width="38.440000000000005%" headers="mcps1.3.1.6.2.4.1.2 "><p id="EN-US_TOPIC_0000001510161265__p85311016013">Year (four digits)</p>
</td>
<td class="cellrowborder" valign="top" width="47.699999999999996%" headers="mcps1.3.1.6.2.4.1.3 "><p id="EN-US_TOPIC_0000001510161265__p1653106016">-</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001510161265__row195415015019"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.1.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001510161265__p165390809">%y</p>
</td>
<td class="cellrowborder" valign="top" width="38.440000000000005%" headers="mcps1.3.1.6.2.4.1.2 "><p id="EN-US_TOPIC_0000001510161265__p12531501706">Year (two digits)</p>
</td>
<td class="cellrowborder" valign="top" width="47.699999999999996%" headers="mcps1.3.1.6.2.4.1.3 "><p id="EN-US_TOPIC_0000001510161265__p135360908">-</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001510161265__row354202010"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.1.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001510161265__p14541409018">%%</p>
</td>
<td class="cellrowborder" valign="top" width="38.440000000000005%" headers="mcps1.3.1.6.2.4.1.2 "><p id="EN-US_TOPIC_0000001510161265__p5541012018">Character '%'</p>
</td>
<td class="cellrowborder" valign="top" width="47.699999999999996%" headers="mcps1.3.1.6.2.4.1.3 "><p id="EN-US_TOPIC_0000001510161265__p165419019018">Character '%'</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001510161265__row754180009"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.1.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001510161265__p1454110102">%<em id="EN-US_TOPIC_0000001510161265__i254502009">x</em></p>
</td>
<td class="cellrowborder" valign="top" width="38.440000000000005%" headers="mcps1.3.1.6.2.4.1.2 "><p id="EN-US_TOPIC_0000001510161265__p55411011012">'<em id="EN-US_TOPIC_0000001510161265__i3549010012">x</em>': any character apart from the preceding ones</p>
</td>
<td class="cellrowborder" valign="top" width="47.699999999999996%" headers="mcps1.3.1.6.2.4.1.3 "><p id="EN-US_TOPIC_0000001510161265__p105420600">Character '<em id="EN-US_TOPIC_0000001510161265__i1454308017">x</em>'</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="notice" id="EN-US_TOPIC_0000001510161265__note11551207017"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><p id="EN-US_TOPIC_0000001510161265__p1055100802">In the preceding table, <strong id="EN-US_TOPIC_0000001510161265__b1917039751101722">%U</strong>, <strong id="EN-US_TOPIC_0000001510161265__b2140873347101722">%u</strong>, <strong id="EN-US_TOPIC_0000001510161265__b496011888101722">%V</strong>, <strong id="EN-US_TOPIC_0000001510161265__b565467652101722">%v</strong>, <strong id="EN-US_TOPIC_0000001510161265__b1320953145101722">%X</strong>, and <strong id="EN-US_TOPIC_0000001510161265__b1754634583101722">%x</strong> are not supported currently.</p>
</div></div>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_06_0035.html">Date and Time Processing Functions and Operators</a></div>
</div>
</div>