doc-exports/docs/dws/dev/dws_06_0312.html
Lu, Huayi e6fa411af0 DWS DEV 830.201 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-05-16 07:24:04 +00:00

292 lines
25 KiB
HTML

<a name="EN-US_TOPIC_0000001446391160"></a><a name="EN-US_TOPIC_0000001446391160"></a>
<h1 class="topictitle1">date_format</h1>
<div id="body0000001446391160"><div class="section" id="EN-US_TOPIC_0000001446391160__section1351015168551"><h4 class="sectiontitle">date_format(timestamp, fmt)</h4><p id="EN-US_TOPIC_0000001446391160__p13496191614553">Converts a date into a string in the format specified by <strong id="EN-US_TOPIC_0000001446391160__b128169824094122">fmt</strong>.</p>
<p id="EN-US_TOPIC_0000001446391160__p114961816105514">Example:</p>
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001446391160__screen1049720169555"><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_0000001446391160__p1749791665517"><a href="#EN-US_TOPIC_0000001446391160__table135107162552">Formats for the output string</a> describes the patterns of date parameter values. They can be used for the <strong id="EN-US_TOPIC_0000001446391160__b89485775894122">date_format</strong>, <strong id="EN-US_TOPIC_0000001446391160__b31205850794122">time_format</strong>, <strong id="EN-US_TOPIC_0000001446391160__b76588803694122">str_to_date</strong>, <strong id="EN-US_TOPIC_0000001446391160__b154816560494122">str_to_time</strong>, and <strong id="EN-US_TOPIC_0000001446391160__b151882929694122">from_unixtime</strong> functions.</p>
<div class="tablenoborder"><a name="EN-US_TOPIC_0000001446391160__table135107162552"></a><a name="table135107162552"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001446391160__table135107162552" 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_0000001446391160__row34981216165516"><th align="left" class="cellrowborder" valign="top" width="13.86%" id="mcps1.3.1.6.2.4.1.1"><p id="EN-US_TOPIC_0000001446391160__p6497111655516">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_0000001446391160__p349861625520">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_0000001446391160__p0498111655513">Value</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001446391160__row94981616135510"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.1.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001446391160__p1349818168552">%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_0000001446391160__p1549801665516">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_0000001446391160__p184982169555">Sun...Sat</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001446391160__row8499101685514"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.1.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001446391160__p84981916195520">%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_0000001446391160__p549851612554">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_0000001446391160__p15498516155517">Jan...Dec</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001446391160__row1749991611555"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.1.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001446391160__p0499131685513">%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_0000001446391160__p16499171655518">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_0000001446391160__p1049919168559">0...12</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001446391160__row11499131665517"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.1.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001446391160__p14991316195516">%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_0000001446391160__p124995163553">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_0000001446391160__p54991916145517">0th, 1st, 2nd, 3rd, ...</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001446391160__row175000166553"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.1.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001446391160__p1249991618557">%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_0000001446391160__p549931617559">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_0000001446391160__p1050061635514">00...31</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001446391160__row4500216125514"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.1.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001446391160__p1950019160553">%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_0000001446391160__p250071615559">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_0000001446391160__p35001116105510">0...31</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001446391160__row65003161552"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.1.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001446391160__p185001416145515">%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_0000001446391160__p6500151611559">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_0000001446391160__p155008162559">000000...999999</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001446391160__row1501121685510"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.1.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001446391160__p6500161655516">%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_0000001446391160__p12501216175518">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_0000001446391160__p1150121635515">00...23</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001446391160__row1850112161556"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.1.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001446391160__p650121615554">%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_0000001446391160__p165015166553">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_0000001446391160__p1150110164555">01...12</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001446391160__row550181605510"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.1.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001446391160__p750116163551">%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_0000001446391160__p15011516175514">Hour, in 12-hour format, same as <strong id="EN-US_TOPIC_0000001446391160__b100341113194122">%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_0000001446391160__p65011216195517">01...12</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001446391160__row150291619557"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.1.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001446391160__p155014168558">%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_0000001446391160__p115011516145519">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_0000001446391160__p850251619550">00...59</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001446391160__row19502161618554"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.1.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001446391160__p650241619558">%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_0000001446391160__p155021716115515">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_0000001446391160__p7502191615516">001...366</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001446391160__row95021316165519"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.1.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001446391160__p7502316135513">%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_0000001446391160__p1950281635513">Hour, in 24-hour format, same as <strong id="EN-US_TOPIC_0000001446391160__b212173160894122">%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_0000001446391160__p55023162553">0...23</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001446391160__row950216161555"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.1.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001446391160__p150220163553">%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_0000001446391160__p85021616185518">Hour, in 12-hour format, same as <strong id="EN-US_TOPIC_0000001446391160__b202810049994122">%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_0000001446391160__p9502121605512">1...12</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001446391160__row55034167551"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.1.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001446391160__p18503101665515">%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_0000001446391160__p5503151615553">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_0000001446391160__p75031916155512">January...December</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001446391160__row14503416175510"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.1.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001446391160__p2503316145511">%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_0000001446391160__p19503116185519">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_0000001446391160__p4503111611557">00...12</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001446391160__row25036164553"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.1.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001446391160__p350361645518">%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_0000001446391160__p4503191685512">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_0000001446391160__p650310167553">AM PM</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001446391160__row1050411162550"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.1.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001446391160__p1350411616559">%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_0000001446391160__p15044166554">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_0000001446391160__p19504116105516">hh::mm::ss AM/PM</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001446391160__row13504416165517"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.1.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001446391160__p4504101665519">%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_0000001446391160__p9504416115515">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_0000001446391160__p5504416195514">00...59</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001446391160__row14505191618551"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.1.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001446391160__p185044162558">%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_0000001446391160__p135051016195516">Second, same as <strong id="EN-US_TOPIC_0000001446391160__b99445658294122">%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_0000001446391160__p1850514163555">00...59</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001446391160__row850512166555"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.1.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001446391160__p4505121613552">%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_0000001446391160__p5505111610553">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_0000001446391160__p20505111615513">hh::mm::ss</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001446391160__row17506181685512"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.1.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001446391160__p195052016175517">%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_0000001446391160__p1505116145514">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_0000001446391160__p9506141616551">00...53</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001446391160__row150631615517"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.1.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001446391160__p4506111619558">%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_0000001446391160__p13506151675510">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_0000001446391160__p250617162554">00...53</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001446391160__row550712166559"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.1.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001446391160__p14506216125520">%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_0000001446391160__p15506141675510">Week (Sunday is the first day of a week). It is used together with <strong id="EN-US_TOPIC_0000001446391160__b37319608294122">%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_0000001446391160__p4506111610553">01...53</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001446391160__row7507141612552"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.1.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001446391160__p8507516155520">%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_0000001446391160__p75072165557">Week (Monday is the first day of a week). It is used together with <strong id="EN-US_TOPIC_0000001446391160__b90827410894122">%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_0000001446391160__p18507416125511">01...53</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001446391160__row7507101613559"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.1.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001446391160__p250715161556">%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_0000001446391160__p55071216165514">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_0000001446391160__p3507716115511">Sunday...Saturday</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001446391160__row175081816125514"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.1.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001446391160__p650811655514">%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_0000001446391160__p1150871619550">Day of a week. The value is <strong id="EN-US_TOPIC_0000001446391160__b108859727694122">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_0000001446391160__p10508181611551">0...6</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001446391160__row165099162553"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.1.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001446391160__p15508116105519">%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_0000001446391160__p185094166557">Year (four digits). It is used together with <strong id="EN-US_TOPIC_0000001446391160__b212953924794122">%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_0000001446391160__p1650971611559">-</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001446391160__row155091916115515"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.1.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001446391160__p19509191619552">%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_0000001446391160__p7509141618559">Year (four digits). It is used together with <strong id="EN-US_TOPIC_0000001446391160__b207244769994122">%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_0000001446391160__p550981675511">-</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001446391160__row75091316145512"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.1.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001446391160__p1250914165557">%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_0000001446391160__p650941695513">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_0000001446391160__p1150981614551">-</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001446391160__row18510616115519"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.1.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001446391160__p450921613558">%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_0000001446391160__p550911613555">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_0000001446391160__p5509191685516">-</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001446391160__row951041625510"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.1.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001446391160__p135101116135517">%%</p>
</td>
<td class="cellrowborder" valign="top" width="38.440000000000005%" headers="mcps1.3.1.6.2.4.1.2 "><p id="EN-US_TOPIC_0000001446391160__p13510131619553">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_0000001446391160__p651016161550">Character '%'</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001446391160__row19510111625512"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.1.6.2.4.1.1 "><p id="EN-US_TOPIC_0000001446391160__p14510201611559">%<em id="EN-US_TOPIC_0000001446391160__i105101516115510">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_0000001446391160__p5510516165515">'<em id="EN-US_TOPIC_0000001446391160__i13510131645515">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_0000001446391160__p1351091665515">Character '<em id="EN-US_TOPIC_0000001446391160__i19510141610558">x</em>'</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="notice" id="EN-US_TOPIC_0000001446391160__note10510191655518"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><p id="EN-US_TOPIC_0000001446391160__p11510151665514">In the preceding table, <strong id="EN-US_TOPIC_0000001446391160__b194342681294122">%U</strong>, <strong id="EN-US_TOPIC_0000001446391160__b33344234094122">%u</strong>, <strong id="EN-US_TOPIC_0000001446391160__b166989887994122">%V</strong>, <strong id="EN-US_TOPIC_0000001446391160__b87015629194122">%v</strong>, <strong id="EN-US_TOPIC_0000001446391160__b192920197094122">%X</strong>, and <strong id="EN-US_TOPIC_0000001446391160__b51427238894122">%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>